Re: BUG #4437: Breaking referential integrity with a trigger

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tim Leppard" <hbug_1(at)hotmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4437: Breaking referential integrity with a trigger
Date: 2008-09-25 17:22:20
Message-ID: 8922.1222363340@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Tim Leppard" <hbug_1(at)hotmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Simon Riggs 2008-09-25 18:50:39 Re: [ADMIN] Postgres Stats after Crash Recovery
Previous Message Tom Lane 2008-09-25 16:22:31 Re: Incorrect "invalid AM/PM string" error from to_timestamp