Re: Have \d show child tables that inherit from the specified parent

From: "damien(at)dalibo(dot)info" <damien(at)dalibo(dot)info>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Have \d show child tables that inherit from the specified parent
Date: 2009-05-10 00:05:48
Message-ID: 4A061A5C.3030108@dalibo.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Here's a second version. Main changes are :

* Child tables are sorted by name
* \d only shows the number of child tables
* \d+ shows the full list

Which gives :

postgres=# \d mother
Table "public.mother"
Column | Type | Modifiers
--------+---------+-----------------------------------------------------
id | integer | not null default nextval('mother_id_seq'::regclass)
This table has 4 child table(s). Use \d+ to display them.

postgres=# \d+ mother
Table "public.mother"
Column | Type | Modifiers
| Storage | Description
--------+---------+-----------------------------------------------------+---------+-------------
id | integer | not null default nextval('mother_id_seq'::regclass)
| plain |
Child tables: daughter,
daughter2,
daughter3,
plop.daughter4
Has OIDs: no

For people having hundreds of child tables, the use of \d+ will still be
uncomfortable. But i must admit that i can't see any better way to
implement this feature, except by adding a new syntax ( \dh to show
specific information about inheritance ? )

Anyway let me know if you think it is not worth going forward on that
feature :-)

--
damien clochard
http://dalibo.org | http://dalibo.com

Attachment Content-Type Size
psql_show_children_tables.v2.patch text/x-patch 1.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2009-05-10 03:01:46 Re: pg_migrator alpha 5 - truncates at 10 M rows
Previous Message Alvaro Herrera 2009-05-10 00:05:36 Re: pg_migrator alpha 5 - truncates at 10 M rows