Thread: deferred constraint trigger problem

deferred constraint trigger problem

From
"Peter Schueller"
Date:
Hello !

I have the following script, which (in my opinion) should not generate an
error at the final commit.

---

create table aaa_test ( id1 varchar(10), id2 int8, d date, t text, primary
key (id1, id2));

create table aab_test (idrep int8, primary key(idrep));

alter table aaa_test

add foreign key (id2)

references aab_test(idrep) match full

on delete no action on update no action deferrable;



insert into aab_test values (1);

insert into aaa_test values ('a',1);

begin work;

set constraints all deferred;

delete from aab_test where idrep=1;

insert into aab_test (idrep) values (1);

commit;

---

The deferred constraint trigger fires even if I insert the 'missing' value 1
immediately back again into the table.

Does someone know about a workaround in the Version 7.2.1-2 I am using ?

I tried to install 7.3 on an uncritical system and there this error did not
occur - or is this behaviour a matter of configuration ?

Thanks,

Peter Schüller


Re: deferred constraint trigger problem

From
Stephan Szabo
Date:
On Tue, 1 Apr 2003, Peter Schueller wrote:

> I have the following script, which (in my opinion) should not generate an
> error at the final commit.

It was a bug that saw some intermediate states that was fixed for 7.3. I
don't think it was backpatched to a later 7.2 (it was somewhat big), but
you might want to check 7.2.4.