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 4A74EEC5.6020905@squeakycode.net
Whole thread Raw
In response to Can I add a super table to existing tables?  (Jun Yang <jyang825@gmail.com>)
Responses Re: Can I add a super table to existing tables?  (Andy Colson <andy@squeakycode.net>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Chris Spotts
Date:
Subject: Re: How to execute external script from a TRIGGER or FUNCTION ?
Next
From: andy
Date:
Subject: Re: Can I add a super table to existing tables?