Re: ON DELETE CASCADE with multiple paths

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Max Khon <mkhon(at)swsoft(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: ON DELETE CASCADE with multiple paths
Date: 2007-05-17 16:15:10
Message-ID: 20070517090941.X9014@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 17 May 2007, Tom Lane wrote:

> Max Khon <mkhon(at)swsoft(dot)com> writes:
> > "delete from foo" fails:
>
> > ERROR: update or delete on table "bar" violates foreign key constraint
> > "foobar_fk0" on table "foobar"
> > SQL state: 23503
> > Detail: Key (bar_id)=(1) is still referenced from table "foobar".
> > Context: SQL statement "DELETE FROM ONLY "public"."bar" WHERE "foo_id" = $1"
>
> I see no bug here. There is no guarantee about the order in which
> constraints are applied.

Except that SQL92 at least does seem to say in 11.8 that "All rows that
are marked for deletion are effectively deleted at the end of the
SQL-statement, prior to the checking of any integrity constraints." I
think that likely makes our behavior wrong, but I'm not really sure how to
get there from what we have now.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Christian Kratzer 2007-05-17 16:42:39 Re: strange problem with ip6
Previous Message Bruce Momjian 2007-05-17 16:14:08 Re: BUG #3266: SSL broken pipes kill the machine and fill the disk