BUG #1307: Possible bug inheritance/referential integrity

Поиск
Список
Период
Сортировка
От PostgreSQL Bugs List
Тема BUG #1307: Possible bug inheritance/referential integrity
Дата
Msg-id 20041106121149.76088739260@www.postgresql.com
обсуждение исходный текст
Ответы Re: BUG #1307: Possible bug inheritance/referential integrity  (Michael Fuhr <mike@fuhr.org>)
Re: BUG #1307: Possible bug inheritance/referential integrity  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      1307
Logged by:          Thomas Jacob

Email address:      jacob@internet24.de

PostgreSQL version: 7.4.5

Operating system:   Gentoo Linux, Kernel 2.6.7

Description:        Possible bug inheritance/referential integrity

Details:

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);

-- this works
INSERT INTO super VALUES(1); INSERT INTO super_ref VALUES(1);

-- clean up
DELETE FROM super_ref; DELETE FROM super;

-- this fails with: ERROR:  insert or update on table "super_ref" violates
foreign key constraint "$1"
INSERT INTO sub VALUES(1); INSERT INTO super_ref VALUES(1);

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

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