Search Postgresql Archives

Re: Can I add a super table to existing tables?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 extras the parent does not, but not visa versa)

-Andy

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux