Skip site navigation (1) Skip section navigation (2)

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

From: David Fetter <david(at)fetter(dot)org>
To: damien clochard <damien(at)dalibo(dot)info>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Have \d show child tables that inherit from thespecified parent
Date: 2009-02-26 00:02:28
Message-ID: 20090226000228.GG19875@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Feb 26, 2009 at 12:25:08AM +0100, damien clochard wrote:
> Hello,
> 
> Last week, i took some time to check if i was still able to write
> some basic C code.  So i looked into the TODO list and picked some
> trivial items.
> 
> This one is very basic, it just shows the child tables of a specific
> table when you type \d <tablename> in psql :
> 
> 
> # create table mother(id SERIAL);
> # create table daughter() inherits(mother);
> # create table daughter2() inherits(mother);
> # create schema plop;
> # create table plop.daughter3() inherits(mother);
> # \d mother
>                          Table "public.mother"
>  Column |  Type   |                      Modifiers
> --------+---------+-----------------------------------------------------
>  id     | integer | not null default nextval('mother_id_seq'::regclass)
> Child tables: daughter,
>               daughter2,
>               plop.daughter3
> 
> 
> I understand that it may not be the best moment to submit such a
> trivial patch, as most of you are working hard on more important
> topics.  If you think i should submit it later, just let me know.
> 
> BTW, this is the first patch i submit so any comment is more than
> welcome.

Should the patch (and the feature) use WITH RECURSIVE in order to get
the entire tree?

Cheers,
David (yes, I know it's predictable from me, but WITH RECURSIVE really
is a neat new toy ;)
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2009-02-26 00:30:30
Subject: Re: Have \d show child tables that inherit from the specified parent
Previous:From: Joshua D. DrakeDate: 2009-02-25 23:26:03
Subject: Re: effective_cache_size less than shared_buffers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group