Re: BUG #3696: FK integrity check bypassed using rules.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pierre-yves Strub" <pierre(dot)yves(dot)strub(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3696: FK integrity check bypassed using rules.
Date: 2007-10-25 16:29:17
Message-ID: 17523.1193329757@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Pierre-yves Strub" <pierre(dot)yves(dot)strub(at)gmail(dot)com> writes:
> CREATE TABLE data (
> id INTEGER PRIMARY KEY DEFAULT nextval('sequence'),
> ref_id INTEGER NULL REFERENCES data(id) ON DELETE CASCADE
> );

> CREATE RULE data_delete_rule
> AS ON DELETE TO data WHERE OLD.ref_id IS NOT NULL
> DO INSTEAD NOTHING;

Yes, a poorly designed rule can invalidate all kinds of expectations
about behavior. This isn't a bug in my humble opinion.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gregory Stark 2007-10-25 16:33:12 Re: Yet another problem with ILIKE and UTF-8
Previous Message Marc Mamin 2007-10-25 16:21:18 Re: BUG #3697: utf8 issue: can not reimport a table that was successfully exported.