*** pgsql/src/bin/psql/describe.c 2009/07/07 19:05:57 1.222 --- pgsql/src/bin/psql/describe.c 2009/07/07 20:32:20 1.223 *************** *** 8,14 **** * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.221 2009/07/07 16:28:38 tgl Exp $ */ #include "postgres_fe.h" --- 8,14 ---- * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.222 2009/07/07 19:05:57 petere Exp $ */ #include "postgres_fe.h" *************** describeOneTableDetails(const char *sche *** 1821,1827 **** PQclear(result); /* print child tables */ ! printfPQExpBuffer(&buf, "SELECT c.oid::pg_catalog.regclass FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i WHERE c.oid=i.inhrelid AND i.inhparent = '%s' ORDER BY c.oid::pg_catalog.regclass::text;", oid); result = PSQLexec(buf.data, false); if (!result) --- 1821,1830 ---- PQclear(result); /* print child tables */ ! if (pset.sversion >= 80300) ! printfPQExpBuffer(&buf, "SELECT c.oid::pg_catalog.regclass FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i WHERE c.oid=i.inhrelid AND i.inhparent = '%s' ORDER BY c.oid::pg_catalog.regclass::text;", oid); ! else ! printfPQExpBuffer(&buf, "SELECT c.oid::pg_catalog.regclass FROM pg_catalog.pg_class c, pg_catalog.pg_inherits i WHERE c.oid=i.inhrelid AND i.inhparent = '%s' ORDER BY c.relname;", oid); result = PSQLexec(buf.data, false); if (!result)