FAQ
Members List
Calendar
Mark Forums Read
[BUGS] lost on referentail integrity
dbTalk Databases Forums
Databases
mailing.database.pgsql-bugs
[BUGS] lost on referentail integrity
mailing.database.pgsql-bugs
mailing.database.pgsql-bugs
Discuss
[BUGS] lost on referentail integrity
in the
mailing.database.pgsql-bugs
forum.
Thread Tools
Display Modes
#
1
Patrice Beliveau
Posts: n/a
[BUGS] lost on referentail integrity -
12-16-2006 , 04:04 PM
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)
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
Patrice Beliveau
#
2
Tom Lane
Posts: n/a
Re: [BUGS] lost on referentail integrity -
12-16-2006 , 04:40 PM
Patrice Beliveau <pbeliveau (AT) avior (DOT) ca> writes:
Quote:
The problem is very simple to reproduce:
[ shrug... ] Your trigger suppressed the cascaded deletes. What were
you expecting to happen?
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
Tom Lane
«
Previous Thread
|
Next Thread
»
Thread Tools
Show Printable Version
Email this Page
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
vB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Contact Us
-
dbTalk Databases Forums
-
Archive
-
Top