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

Поиск
Список
Период
Сортировка
От Andy Colson
Тема Re: Can I add a super table to existing tables?
Дата
Msg-id 4A74EEC5.6020905@squeakycode.net
обсуждение исходный текст
Ответ на Can I add a super table to existing tables?  (Jun Yang <jyang825@gmail.com>)
Ответы Re: Can I add a super table to existing tables?
Список 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 по дате отправления:

Предыдущее
От: Chris Spotts
Дата:
Сообщение: Re: How to execute external script from a TRIGGER or FUNCTION ?
Следующее
От: andy
Дата:
Сообщение: Re: Can I add a super table to existing tables?