Re: [BUGS] BUG #5505: Busted referential integrity with triggers

2010-06-14 Thread Tom Lane
"Tommy McDaniel" writes: > I can understand firing the triggers. But what's up with not checking that > the foreign key constraint is met? If the user has to manually ensure that > values maintain referential integrity, why have foreign keys at all? The > whole point of foreign keys is to make

Re: [BUGS] BUG #5505: Busted referential integrity with triggers

2010-06-14 Thread Tommy McDaniel
ntial integrity is maintained instead of having to do it manually. Tommy McDaniel -Original Message- From: "Tom Lane" [...@sss.pgh.pa.us] Date: 06/14/2010 08:13 AM To: "Tommy McDaniel" CC: pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #5505: Busted referentia

Re: [BUGS] BUG #5505: Busted referential integrity with triggers

2010-06-14 Thread Tom Lane
"Tommy McDaniel" writes: > Let us also create a trigger to disable UPDATEs on table_2: > ... > And, we have now broken referential integrity. Yup, this is not a bug, it's a feature. Triggers fire on referential-integrity updates. (If they didn't, you could not for example have a logging trigger

[BUGS] BUG #5505: Busted referential integrity with triggers

2010-06-14 Thread Tommy McDaniel
The following bug has been logged online: Bug reference: 5505 Logged by: Tommy McDaniel Email address: tommst...@myway.com PostgreSQL version: 8.4.4 Operating system: Kubuntu 9.10 Description:Busted referential integrity with triggers Details: Let us create a table