+ " pg_catalog.pg_get_constraintdef(oid, true) as condef\n"
+ "FROM pg_catalog.pg_constraint c\n"
+ "WHERE c.confrelid = '%s' AND c.contype = 'f' ORDER BY 1",
+ oid);
+ result6 = PSQLexec(buf.data, false);
+ if (!result6)
+ {
+ PQclear(result1);
+ PQclear(result2);
+ PQclear(result3);
+ PQclear(result4);
+ PQclear(result5);
+ goto error_return;
+ }
+ else
+ referencedby_count = PQntuples(result6);
+ }
+
/* count inherited tables */
/* count inherited tables */
- printfPQExpBuffer(&buf, "SELECT c.oid::regclass FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i WHERE c.oid=i.inhparent AND i.inhrelid = '%s' ORDER BY inhseqno ASC", oid);
+ printfPQExpBuffer(&buf, "SELECT c.oid::pg_catalog.regclass FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i WHERE c.oid=i.inhparent AND i.inhrelid = '%s' ORDER BY inhseqno", oid);