Problem (bug?) with deferred foreign key checks?

Поиск
Список
Период
Сортировка
От 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?  ("Joshua b. Jore" <josh@greentechnologist.org>)
Re: Problem (bug?) with deferred foreign key checks?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список 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 по дате отправления:

Предыдущее
От: Curt Sampson
Дата:
Сообщение: Re: sort_mem sizing (Non-linear Performance)
Следующее
От: Curt Sampson
Дата:
Сообщение: Re: How to start without password