Problem (bug?) with deferred foreign key checks?
Вложения
В списке pgsql-general по дате отправления:
| От | Adrian 'Dagurashibanipal' von Bidder |
|---|---|
| Тема | Problem (bug?) with deferred foreign key checks? |
| Дата | |
| Msg-id | 1023695597.10558.66.camel@atlas обсуждение исходный текст |
| Ответы |
Re: Problem (bug?) with deferred foreign key checks?
Re: Problem (bug?) with deferred foreign key checks? |
| Список | pgsql-general |
Yo!
Why is it not possible to temporarily have illegal values in a table,
and update them during the transaction to point to real entries in the
'super' table?
=====
avbidder=> create table super (id integer unique);
NOTICE: [...]
CREATE
avbidder=> create table sub (sid integer references super(id) deferrable
initially deferred);
NOTICE: [...]
CREATE
avbidder=> begin;
BEGIN
avbidder=> insert into sub values (2);
INSERT 53513 1
avbidder=> insert into super values (1);
INSERT 53514 1
avbidder=> update sub set sid = 1 where sid = 2;
UPDATE 1
avbidder=> commit;
ERROR: <unnamed> referential integrity violation - key referenced from
sub not found in super
=====
(This is Debian package 7.1.3-7, but I'm told it's there with other
versions, too)
cheers
-- vbi
--
secure email with gpg avbidder@fortytwo.ch: key id 0x92082481
avbidder@acter.ch: key id 0x5E4B731F
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера