@@ -772,50 +989,54 @@ getTableAttrs(TableInfo* tblinfo, int numTables)
...
@@ -772,50 +989,54 @@ getTableAttrs(TableInfo* tblinfo, int numTables)
for(i=0;i<numTables;i++){
for(i=0;i<numTables;i++){
/* skip archive tables */
/* skip archive tables */
if(isArchiveName(tblinfo[i].relname))
if(isArchiveName(tblinfo[i].relname))
continue;
continue;
/* find all the user attributes and their types*/
/* find all the user attributes and their types*/
/* we must read the attribute names in attribute number order! */
/* we must read the attribute names in attribute number order! */
/* because we will use the attnum to index into the attnames array
/* because we will use the attnum to index into the attnames array
later */
later */
if(g_verbose)
if(g_verbose)
fprintf(stderr,"%s finding the attrs and types for table: %s %s\n",
fprintf(stderr,"%s finding the attrs and types for table: %s %s\n",
g_comment_start,
g_comment_start,
tblinfo[i].relname,
tblinfo[i].relname,
g_comment_end);
g_comment_end);
sprintf(q,"SELECT a.attnum, a.attname, t.typname, a.attlen from pg_attribute a, pg_type t where a.attrelid = '%s'::oid and a.atttypid = t.oid and a.attnum > 0 order by attnum",tblinfo[i].oid);
"SELECT t1.relname as indexrelname, t2.relname as indrelname, i.indproc, i.indkey[0], o.opcname as indclassname, a.amname as indamname from pg_index i, pg_class t1, pg_class t2, pg_opclass o, pg_am a where t1.oid = i.indexrelid and t2.oid = i.indrelid and o.oid = i.indclass[0] and t1.relam = a.oid and i.indexrelid > '%d'::oid and t2.relname !~ '^pg_' and t1.relname !~ '^Xinx' ;",
"SELECT t1.relname as indexrelname, t2.relname as indrelname, "
g_last_builtin_oid);
"i.indproc, i.indkey[0], o.opcname as indclassname, "
"a.amname as indamname from pg_index i, pg_class t1, "
"pg_class t2, pg_opclass o, pg_am a "
"where t1.oid = i.indexrelid and t2.oid = i.indrelid "
"and o.oid = i.indclass[0] and t1.relam = a.oid and "
"i.indexrelid > '%d'::oid and t2.relname !~ '^pg_' "