deferred constraints don't work correctly - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject deferred constraints don't work correctly
Date
Msg-id 200103221143.f2MBh6k38019@hub.org
Whole thread Raw
List pgsql-bugs
Robert Bihlmeyer (robbe@orcus.priv.at) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
deferred constraints don't work correctly

Long Description
Using the example code, I get "ERROR:  <unnamed> referential integrity violation - key in foo still referenced from
bar".It should be ok to delete and reinsert referenced keys with deferred contraints -- that's one of their points,
ain'tit? 

Sample Code
create table foo(
  key int primary key,
  val varchar
);

create table bar(
  foo int references foo(key) deferrable initially deferred,
  attr varchar
);

insert into foo(key, val)  values (1, 'one');
insert into foo(key, val)  values (2, 'two');
insert into bar(foo, attr) values (1, 'low');
insert into bar(foo, attr) values (1, 'small');
insert into bar(foo, attr) values (2, 'higher');
insert into bar(foo, attr) values (2, 'bigger');

begin work;
  delete from foo where key = 1;
  insert into foo(key, val) values (1, 'uno');
commit;


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: Giles Lean
Date:
Subject: 7.1beta6 on NetBSD-1.5/i386 fails geometry test in 'make check'
Next
From: Giles Lean
Date:
Subject: 7.1beta6 on NetBSD-1.5/i386 fails geometry test in 'make check'