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,                                                          [EMAIL PROTECTED]
           Stephen R. van den Berg (AKA BuGless).

"-- hit any user to continue"

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to