Re: INHERIT

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: INHERIT
Дата
Msg-id 3B9BB3BD.1B09ABFF@tm.ee
обсуждение исходный текст
Ответ на Re: INHERIT  ("Oliver Elphick" <olly@lfix.co.uk>)
Список pgsql-hackers
Oliver Elphick wrote:
> 
> Peter Harvey wrote:
>   >If I try to get the columns from pg_attribute using the oid of a child
>   >table created with INHERIT I get its columns AND all of its inherited
>   >columns.
>   >
>   >How do I just get the columns added by the child table?
>   >
>   >I figure I could check each column to see if they also exist in
>   >pg_attribute under a parent table but I figure there must be an
>   >easier/faster way? Another pg_* table perhaps? Besides; I am not certian
>   >this would work if there is a common column between a child and one of
>   >its parents (if that is even allowed)?

hannu=# \d parent         Table "parent"Attribute |  Type   | Modifier 
-----------+---------+----------parid     | integer | not null
Index: parent_pkey

hannu=# create table badchild (parid text) inherits (parent);
NOTICE:  CREATE TABLE: merging attribute "parid" with inherited
definition
ERROR:  CREATE TABLE: attribute "parid" type conflict (int4 and text)
hannu=# 

And anyway, in the current state I would advise you not to put too much 
hope in postgreSQL's OO features, especially inheritance ;)

-------------
Hannu


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: Timezones and time/timestamp values in FE/BE protocol
Следующее
От: "Jim Buttafuoco"
Дата:
Сообщение: pg_dump -C and locations (with subject this time)