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

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 (view raw or flat)
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

pgsql-bugs by date

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

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