Sort child tables by name instead of OID in \d+ display

This was an oversight in the recent patch.  Found by Tom Lane.
This commit is contained in:
Peter Eisentraut 2009-07-07 19:05:57 +00:00
parent 8fe8ac5f40
commit 987281274f

View file

@ -8,7 +8,7 @@
* *
* Copyright (c) 2000-2009, PostgreSQL Global Development Group * 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 $ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.222 2009/07/07 19:05:57 petere Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
@ -1821,7 +1821,7 @@ describeOneTableDetails(const char *schemaname,
PQclear(result); PQclear(result);
/* print child tables */ /* 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;", oid); 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); result = PSQLexec(buf.data, false);
if (!result) if (!result)