/* Get the internal database type of the given column.  */
static char* getcolumntype(PGconn *conn, PGresult *result, int i, char *buff)
/* Get the internal database type of the given column.  */
static char* getcolumntype(PGconn *conn, PGresult *result, int i, char *buff)
{
		if (PQntuples(res) > 0) {
			char *name = PQgetvalue(res, 0, 0);
			if (strcmp (name, "bpchar")==0 || strcmp (name, "varchar")==0) {
				int modifier = PQfmod (result, i) - 4;
				sprintf (buff, "%.20s (%d)", name, modifier);
			}
			else
				strncpy (buff, name, 20);
		}
	}
	PQclear(res);
	return buff;
}