BUG #6054: Insert to table, which has fkey to table,which is parenttable for another table - error

Поиск
Список
Период
Сортировка
От Alex
Тема BUG #6054: Insert to table, which has fkey to table,which is parenttable for another table - error
Дата
Msg-id 201106071244.p57CiQfg068192@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #6054: Insert to table, which has fkey to table,which is parenttable for another table - error  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      6054
Logged by:          Alex
Email address:      alexander.ochkalyuk@gmail.com
PostgreSQL version: 8.4.8
Operating system:   CentOS
Description:        Insert to table, which has fkey to table,which is
parenttable for another table - error
Details:

CREATE TABLE t1
(t1_id numeric(10,0) NOT NULL PRIMARY KEY);

CREATE TABLE t2
(t2_id numeric(10,0) NOT NULL PRIMARY KEY) INHERITS (t1);


CREATE TABLE t3
(t3_id numeric(10,0) NOT NULL PRIMARY KEY ,
t1_id numeric(10,0) NOT NULL REFERENCES t1(t1_id)) ;



INSERT INTO t2 VALUES(1,2);
INSERT INTO t3 VALUES(3,1);


ERROR:  insert or update on table "t3" violates ---
foreign key constraint "t3_t1_id_fkey"
     DETAIL:  Key (t1_id)=(1) is not present in table "t1".


BUT!!!!
SELECT t1_id FROM t1 WHERE t1_id = 1;
-->1

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: BUG #6050: Dump and restore of view after a schema change: can't restore the view
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #6041: Unlogged table was created bad in slave node