lost on referentail integrity

From: Patrice Beliveau <pbeliveau(at)avior(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Subject: lost on referentail integrity
Date: 2006-12-15 19:26:07
Message-ID: 4582F6CF.3060004@avior.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

I'm using PostgreSQL 8.1.4

The problem is very simple to reproduce:

create table test1 (
pk1 text not null,
df1 text,
primary key(pk1)
);

create table test2 (
pk1 text not null,
pk2 text not null,
df2 text,
primary key(pk1,pk2)
);

alter table test2 add constraint c1 foreign key (pk1) references test1(pk1)
on update cascade
on delete cascade;

create or replace function f1() returns "trigger" as '
begin
return null;
end;
' language "plpgsql";

create trigger trig1 before delete on test2 for each row execute
procedure f1();

insert into test1 values('foo','foo');

insert into test2 values('foo','oof','foooof');

delete from test1;

select * from test2;
pk1 | pk2 | df2
-----+-----+--------
foo | oof | foooof
(1 row)

select * from test1;
pk1 | df1
-----+-----
(0 rows)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message martin.pihlak 2006-12-16 12:28:51 BUG #2830: Wrong results for prepared statements while clustering target table
Previous Message Sean 2006-12-15 16:07:17 BUG #2829: Runaway logs - "SSL SYSCALL error"