referential integrity error

Поиск
Список
Период
Сортировка
От Matej Hollý
Тема referential integrity error
Дата
Msg-id 3D05DB2B.8050509@krs.sk
обсуждение исходный текст
Ответы Re: referential integrity error  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-bugs
/* If a table contains two or more foreign keys referencing the same table and they reference the same record in the
othertable, the record's primary key cannot be changed even if the keys have the "ON UPDATE CASCADE" clause (see
examplebelow). It will say that "referential integrity error - key referenced from `table' not found in `table'". 
*/

CREATE TABLE "Bug1" ( "ID" INT4, "Description" TEXT NOT NULL, PRIMARY KEY("ID")
);
CREATE TABLE "Bug2" ( "ID" INT4, "Source" INT4 NOT NULL   REFERENCES "Bug1" ON UPDATE CASCADE ON DELETE NO ACTION,
"Destination"INT4 NOT NULL   REFERENCES "Bug1" ON UPDATE CASCADE ON DELETE NO ACTION, "Description" TEXT NOT NULL,
PRIMARYKEY ("ID") 
);
INSERT INTO "Bug1" VALUES (1,'Place');
INSERT INTO "Bug2" VALUES (10,1,1,'Move from Place to Place');
UPDATE "Bug1" SET "ID"=2 WHERE "ID"=1;




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

Предыдущее
От: srb@cuci.nl (Stephen R. van den Berg)
Дата:
Сообщение: Referential integrity problem postgresql 7.2 ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug #689: Bug at moving cursor on joined tables