\d omits schema on inherited tables (Was: EXPLAIN omits schema?)

From: "Josh Tolley" <eggyknap(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Dave Page" <dpage(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: \d omits schema on inherited tables (Was: EXPLAIN omits schema?)
Date: 2007-06-13 17:27:00
Message-ID: e7e0a2570706131027y188c5578y6172f15f961afee9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/13/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Josh Tolley" <eggyknap(at)gmail(dot)com> writes:
> > On a different sideline based on the original note of this thread,
> > much as EXPLAIN doesn't include the schema, \d doesn't include the
> > schema to describe INHERIT relationships in 8.2.4. If you have two
> > tables called PARENT, in two different schemas, and a child that
> > inherits from one of them, \d won't tell you which of the two it
> > inherits from.
>
> Yes it does, because that's actually regclass output. It'll be
> schema-qualified if the table is not visible in your search path.

I figured it was better to start a new thread, since this changes from
the original topic. My test didn't display the schema despite the
parent not being in my search path, as shown below:

[jtolley(at)polonium ~]$ psql
Welcome to psql 8.2.4, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

jtolley=# create schema a;
CREATE SCHEMA
jtolley=# create schema b;
CREATE SCHEMA
jtolley=# set search_path to a, public;
SET
jtolley=# create table parent (f int);
CREATE TABLE
jtolley=# set search_path to b, public;
SET
jtolley=# create table parent (g text);
CREATE TABLE
jtolley=# create table child () inherits (a.parent);
CREATE TABLE
jtolley=# \d child
Table "b.child"
Column | Type | Modifiers
--------+---------+-----------
f | integer |
Inherits: parent

jtolley=# \d parent
Table "b.parent"
Column | Type | Modifiers
--------+------+-----------
g | text |

jtolley=# \d a.parent
Table "a.parent"
Column | Type | Modifiers
--------+---------+-----------
f | integer |

jtolley=# set search_path to b;
SET
jtolley=# \d child
Table "b.child"
Column | Type | Modifiers
--------+---------+-----------
f | integer |
Inherits: parent

jtolley=# set search_path to a;
SET
jtolley=# \d b.child
Table "b.child"
Column | Type | Modifiers
--------+---------+-----------
f | integer |
Inherits: parent

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2007-06-13 17:28:20 Re: Tom Lane's presentation on SERIALIZABLE etc?
Previous Message Greg Sabino Mullane 2007-06-13 16:12:31 Re: EXPLAIN omits schema?