Re: BUG #1307: Possible bug inheritance/referential integrity

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: BUG #1307: Possible bug inheritance/referential integrity
Дата
Msg-id 20041106075734.A99615@megazone.bigpanda.com
обсуждение исходный текст
Ответ на BUG #1307: Possible bug inheritance/referential integrity  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
Список pgsql-bugs
On Sat, 6 Nov 2004, PostgreSQL Bugs List wrote:

> Rows inserted into a table "sub" inherited from a table
> "super" do not seem to exist in the super-table from the point of
> view of the foreign key constraint checker in references to the
> "super"-table, even though a SELECT query displays the rows that
> were inserted into sub also in super, as should be (See example
> provided).
>
> But they should exist, shouldn't they? Or do I simply not
> understand PostgreSQL's inheritance model correctly?
>
> CREATE TABLE super (id INT PRIMARY KEY);
> CREATE TABLE super_ref (id INT REFERENCES super);
> CREATE TABLE sub () INHERITS(super);

Inheritance really just doesn't work very well right now when combined
with constraints.

For example, sub has no primary key and even if you defined one on sub(id)
it wouldn't guarantee that you didn't have duplicates between super and
sub.  Foreign keys currently reference as if you said ONLY, so the
references constraint above references only super and not any child.
It needs someone to really put effort into making it better.

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: BUG #1307: Possible bug inheritance/referential integrity
Следующее
От: Tom Lane
Дата:
Сообщение: Re: domain on bit(N) type produces strange results