Re: PostgreSQL 7.4.2 allows foreign key violation - Mailing list pgsql-general

From Stephan Szabo
Subject Re: PostgreSQL 7.4.2 allows foreign key violation
Date
Msg-id 20040806103819.U14674@megazone.bigpanda.com
Whole thread Raw
In response to Re: PostgreSQL 7.4.2 allows foreign key violation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, 6 Aug 2004, Tom Lane wrote:

> Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> > On Fri, 6 Aug 2004, Tom Lane wrote:
> >> Already does what?  I see nothing in there that would override either
> >> triggers or rules...
>
> > It's not for overriding the triggers or rules, but instead checking that
> > the post action state is valid (by running the no action code which
> > makes sure that either another row now has the pk value or that there are
> > no longer any matching rows).
>
> Oh, I see.  Seems an awfully expensive solution though :-(

Yeah.  That's the major downside. We could potentially do it only if there
are any instead rules or before triggers on the action we want to do
(either delete or update). I'm not sure if/how expensive that would be to
determine.  I think we could potentially check rules when the query is
planned (since presumably, those are the only rules that matter), but I
don't think that'd work for the triggers.


pgsql-general by date:

Previous
From: Randy Yates
Date:
Subject: Re: Postgres and Tools Intro?
Next
From: "Joshua D. Drake"
Date:
Subject: Re: replication