Re: BUG #5505: Busted referential integrity with triggers - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5505: Busted referential integrity with triggers
Date
Msg-id 26428.1276573263@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #5505: Busted referential integrity with triggers  ("Tommy McDaniel" <tommstein@myway.com>)
List pgsql-bugs
"Tommy McDaniel" <tommstein@myway.com> writes:
> I can understand firing the triggers. But what's up with not checking that the foreign key constraint is met? If the
userhas to manually ensure that values maintain referential integrity, why have foreign keys at all? The whole point of
foreignkeys is to make the database ensure referential integrity is maintained instead of having to do it manually. 

[ shrug... ]  The database is doing its best.  Do you really want us to
incur the extra overhead of checking that a trigger didn't screw things
up?  Exactly how far should that go?  For instance, maybe we have to
check that the trigger didn't queue a subsequent event that will make
the undesired change after we look?  I can assure you that far more
people would complain about the useless overhead induced by rechecking
than will complain about the fact that they can write triggers that will
fire on RI updates.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Tommy McDaniel"
Date:
Subject: Re: BUG #5505: Busted referential integrity with triggers
Next
From: 中嶋 信二
Date:
Subject: Re: BUG #5507: missing chunk number 0 for toast value XXXXX in pg_toast_XXXXX