bug in deferred triggers ?

From: ps(at)solution-x(dot)at
To: pgsql-general(at)postgresql(dot)org
Subject: bug in deferred triggers ?
Date: 2003-04-01 15:47:14
Message-ID: "H000007000112f26.1049212033.contact.solution-x.at*"@MHS
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Peter Csaba 2003-04-01 15:54:06 Rules, Triggers something more challenging
Previous Message Tom Lane 2003-04-01 15:42:45 Re: Dates in inserts