Re: Referential Integrity Question (Delete/Insert during Transaction)

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Stef Telford <stef(at)chronozon(dot)artofdns(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Referential Integrity Question (Delete/Insert during Transaction)
Date: 2001-06-18 22:59:25
Message-ID: Pine.BSF.4.21.0106181557230.87232-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 18 Jun 2001, Stef Telford wrote:
>
> I seem to have hit what i -think- may be a bug (but i am not crying
> wolf jst yet ;).
>
> I have three tables. action, client and order_details. action has a primary
> key 'order', client references action (along with adding the client_id as
> part of its primary key), order_details references client (both parts of the
> primary key there). all foreign keys (order in client and order+client_id in
> order_details) are set to INITIALLY DEFERRED. so far so good i hope.
>
> Now. the way i understand it, shouldnt the integrity of any foreign keys
> be checked at the -end- of the transaction, after all the commands have been
> processed ? it seems that the DELETE is being processed and rejected, but
> the foreign key would be 'okay' due to the following INSERT. I have tried
> SET CONSTRAINTS as well with no difference :\

Yes. There's a problem where intermediate conditions are being checked in
certain sequences of deferred constraints. It should be fixed for 7.2.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Hugh Mandeville 2001-06-19 02:13:06 Re: storing special characters
Previous Message Christopher Smith 2001-06-18 22:23:57 Re: [SQL] Problems ensuring uniqueness?