Skip site navigation (1) Skip section navigation (2)

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: (view raw or whole 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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group