deferred constraint trigger problem - Mailing list pgsql-general

From Peter Schueller
Subject deferred constraint trigger problem
Date
Msg-id 035101c2f867$241633f0$0805640a@future
Whole thread Raw
Responses Re: deferred constraint trigger problem
List pgsql-general
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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Dates in inserts
Next
From: Tom Lane
Date:
Subject: Re: dropping a table with dependencies