Identify schema of inherited table in psql \d when necessary.
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 20 Feb 2007 10:23:38 +0000 (10:23 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 20 Feb 2007 10:23:38 +0000 (10:23 +0000)
by Bernd Helmle

src/bin/psql/describe.c

index 80e3f02c6c1af1ece201270d1db0e3882a7eb04a..bd4303bc9ba4876b58b1f5160fb841ed550d8c16 100644 (file)
@@ -1188,7 +1188,7 @@ describeOneTableDetails(const char *schemaname,
                }
 
                /* count inherited tables */
-               printfPQExpBuffer(&buf, "SELECT c.relname 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::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);
 
                result6 = PSQLexec(buf.data, false);
                if (!result6)