Re: BUG #4437: Breaking referential integrity with a trigger - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4437: Breaking referential integrity with a trigger
Date
Msg-id 8922.1222363340@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4437: Breaking referential integrity with a trigger  ("Tim Leppard" <hbug_1@hotmail.com>)
List pgsql-bugs
"Tim Leppard" <hbug_1@hotmail.com> writes:
> Returning NULL from a BEFORE DELETE trigger function on a referencing table
> using CASCADE allows you to break RI.

Yup, so don't do that ;-).  Actually there are any number of ways to
break an RI constraint with poorly designed triggers.  The only way
we could prevent it is to make RI updates not fire triggers, which seems
a cure worse than the disease.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Tim Leppard"
Date:
Subject: BUG #4437: Breaking referential integrity with a trigger
Next
From: Simon Riggs
Date:
Subject: Re: [ADMIN] Postgres Stats after Crash Recovery