Re: Can I add a super table to existing tables? - Mailing list pgsql-general

From Andy Colson
Subject Re: Can I add a super table to existing tables?
Date
Msg-id 4A74F0A3.7050206@squeakycode.net
Whole thread Raw
In response to Re: Can I add a super table to existing tables?  (Andy Colson <andy@squeakycode.net>)
List pgsql-general
Andy Colson wrote:
> Jun Yang wrote:
>> Hi all,
>>
>> I want to add some common columns to all of my tables.  One way I
>> think would be to add a super table that contains the common columns
>> to all tables.  But is there a way to add a super table to existing
>> tables for them to inherit from?
>>
>> Thanks!
>>
>> Jun
>>
>
> as long as the parent and child has the same table struct, yes.
>
> use:
>
> alter table child inherit newparent;
>
> -Andy

err... sorry, let me fix that:  the parent must have a common subset of all the children.  (The children can have
extrasthe parent does not, but not visa versa) 

-Andy

pgsql-general by date:

Previous
From: andy
Date:
Subject: Re: Can I add a super table to existing tables?
Next
From: David Fetter
Date:
Subject: Re: Can I add a super table to existing tables?