Re: PostgreSQL 7.4.2 allows foreign key violation

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Markus Bertheau <twanger(at)bluetwanger(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL 7.4.2 allows foreign key violation
Date: 2004-08-09 03:31:27
Message-ID: 4116F00F.6070104@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/6/2004 1:23 PM, Tom Lane wrote:
> Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)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 :-(

IMHO it is one of the cases that are on the line of "doctor, when I ...
then don't do it". As you said, there is no perfect solution. Triggers
and rules can conflict in several ways, but we don't want to sacrifice
one for making the other failsafe.

Jan

>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message CSN 2004-08-09 04:31:35 COPY, \copy with defaults
Previous Message Alvaro Herrera Munoz 2004-08-09 03:26:57 Re: Losing records when server hang