"proretset, proargtypes, prosrc, probin from pg_proc "
"where oid > '%d'::oid",
g_last_builtin_oid);
res=PQexec(g_conn,query);
if(!res||
PQresultStatus(res)!=PGRES_TUPLES_OK){
fprintf(stderr,"getFuncs(): SELECT failed");
fprintf(stderr,"getFuncs(): SELECT failed\n");
exit_nicely(g_conn);
}
...
...
@@ -657,12 +872,14 @@ getTables(int *numTables)
PQclear(res);
sprintf(query,
"SELECT oid, relname, relarch from pg_class where relkind = 'r' and relname !~ '^pg_' and relname !~ '^Xinv' order by oid;");
"SELECT oid, relname, relarch from pg_class "
"where relkind = 'r' and relname !~ '^pg_' "
"and relname !~ '^Xinv' order by oid;");
res=PQexec(g_conn,query);
if(!res||
PQresultStatus(res)!=PGRES_TUPLES_OK){
fprintf(stderr,"getTables(): SELECT failed");
fprintf(stderr,"getTables(): SELECT failed\n");
exit_nicely(g_conn);
}
...
...
@@ -725,7 +942,7 @@ getInherits(int *numInherits)
res=PQexec(g_conn,query);
if(!res||
PQresultStatus(res)!=PGRES_TUPLES_OK){
fprintf(stderr,"getInherits(): SELECT failed");
fprintf(stderr,"getInherits(): SELECT failed\n");
exit_nicely(g_conn);
}
...
...
@@ -786,11 +1003,15 @@ getTableAttrs(TableInfo* tblinfo, int numTables)
tblinfo[i].relname,
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, "
"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' ;",
g_last_builtin_oid);
res=PQexec(g_conn,query);
if(!res||
PQresultStatus(res)!=PGRES_TUPLES_OK){
fprintf(stderr,"getIndices(): SELECT failed");
fprintf(stderr,"getIndices(): SELECT failed\n");
exit_nicely(g_conn);
}
...
...
@@ -939,7 +1167,9 @@ dumpTypes(FILE* fout, FuncInfo* finfo, int numFuncs,