Referential integrity problem postgresql 7.2 ?

From: srb(at)cuci(dot)nl (Stephen R(dot) van den Berg)
To: pgsql-bugs(at)postgresql(dot)org
Subject: Referential integrity problem postgresql 7.2 ?
Date: 2002-06-10 21:58:33
Message-ID: 20020610215833.GA1782@cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Should the following piece of code cause an:
ERROR: <unnamed> referential integrity violation - key referenced
from b not found in a
Or should it work because the check is deferred and in the
end no violations are present?

create table a(ia int primary key);
create table b(ia int references a initially deferred);
insert into a values (7);
begin;
insert into b values (-7);
update b set ia=-ia where ia<0;
commit;
drop table a;
drop table b;

--
Sincerely, srb(at)cuci(dot)nl
Stephen R. van den Berg (AKA BuGless).

"-- hit any user to continue"

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-06-11 01:53:08 Bug #688: dump/reinstall fails with local sameuser security
Previous Message Bruce Momjian 2002-06-10 19:57:15 Re: Bug #640: ECPG: inserting float numbers

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2002-06-10 22:36:42 Re: Default privileges for new databases (was Re: Can't import large objects in most recent cvs)
Previous Message Yuva Chandolu 2002-06-10 21:42:33 Will postgress handle too big tables?