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