ast_debug(1,"Table '%s' not found in cache, querying now\n",tablename);
ast_debug(1,"Table '%s' not found in cache, querying now\n",tablename);
/* Not found, scan the table */
/* Not found, scan the table */
ast_str_set(&sql,0,"SELECT a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc FROM pg_class c, pg_type t, pg_attribute a LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum WHERE c.oid = a.attrelid AND a.atttypid = t.oid AND (a.attnum > 0) AND c.relname = '%s' ORDER BY c.relname, attnum",tablename);
ast_str_set(&sql,0,"SELECT a.attname, t.typname, a.attlen, a.attnotnull, d.adsrc, a.atttypmod FROM pg_class c, pg_type t, pg_attribute a LEFT OUTER JOIN pg_attrdef d ON a.atthasdef AND d.adrelid = a.attrelid AND d.adnum = a.attnum WHERE c.oid = a.attrelid AND a.atttypid = t.oid AND (a.attnum > 0) AND c.relname = '%s' ORDER BY c.relname, attnum",tablename);
result=PQexec(pgsqlConn,sql->str);
result=PQexec(pgsqlConn,sql->str);
ast_debug(1,"Query of table structure complete. Now retrieving results.\n");
ast_debug(1,"Query of table structure complete. Now retrieving results.\n");
ast_log(LOG_WARNING,"Column '%s' is of the incorrect type: (need %s(%d) but saw %s)\n",column->name,type==RQ_CHAR?"char":type==RQ_DATETIME?"datetime":type==RQ_DATE?"date":type==RQ_FLOAT?"float":"a rather stiff drink ",size,column->type);
ast_log(LOG_WARNING,"Column '%s' is of the incorrect type: (need %s(%d) but saw %s)\n",