Re: Delete Order When Referential Integrity Is Active

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: SZUCS Gábor <surrano(at)mailbox(dot)hu>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Delete Order When Referential Integrity Is Active
Date: 2002-11-27 18:01:13
Message-ID: 20021127095012.C94704-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 27 Nov 2002, [iso-8859-1] SZUCS Gbor wrote:

> ----- Original Message -----
> From: "Stephan Szabo" <sszabo(at)megazone23(dot)bigpanda(dot)com>
> Sent: Tuesday, November 26, 2002 4:23 AM
>
>
> > the behavior you're looking for. I haven't really looked to see if
> > there's anything in the spec about the timing of dependent deletes as
> > associated with triggers, though.
>
>
> There is something in the docs about tuple visibility that states, "if a
> query affects a row, each query in time after this one, no matter if it's
> triggered by the original query or it's an independent query, sees the new
> state of the tuple" or something like that.
>
> Doesn't it apply to this case? I mean, reference is effectively a trigger,
> something like
>
> ... AFTER DELETE ON MasterTable FROM DetailTable ...
>
> so the DELETE's on DetailTable _must_ follow (in time) the DELETE on
> MasterTable. Maybe it's the exact cause that the master row is deleted
> first.

That's why it does in practice. The question is whether that is compliant
behavior to the spec which I believe we are for this case although I'm not
sure about all of the cases.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2002-11-27 18:08:23 fatal error in database
Previous Message Al Bean 2002-11-27 17:58:28 versions