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

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

Предыдущее
От: andy
Дата:
Сообщение: Re: Can I add a super table to existing tables?
Следующее
От: David Fetter
Дата:
Сообщение: Re: Can I add a super table to existing tables?