Greg Sabino Mullane wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


This one is very basic, it just shows the child tables of a specific
table when you type \d <tablename> in psql :

I'm not so jazzed about this, as I work on systems that have literally
hundreds of child tables.

hi everyone.

Thanks for your comments.

I must admit that i didn't asked myself much questions when i implemented that feature. As i said i picked that item almost randomly in the todo list. I choosed to show child table on \d instead \d+ in order to be consistant with the fact that \d shows the mother of the specified table.

That being said i recognize that people who have dozens of child tables might get annoyed by this patch.

Here's 3 ideas that could make things better :

1- When using \d , only show the numbers of child tables

2- Only display the list of child table when \d+ is used. (mode ???)

3- Display the child table names in line, instead of one line per table.

Here's what it would look like :

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

#\d+ mother
                        Table "public.mother"
 Column |  Type   |                      Modifiers
--------+---------+-----------------------------------------------------
 id     | integer | not null default nextval('mother_id_seq'::regclass)
Child tables : daughter1, daughter2, daughter3, daughter4, daughter5


Does it look better ?

--
damien clochard
dalibo.org | dalibo.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to