Re: Foreign Key Constraint Deletion Order

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Foreign Key Constraint Deletion Order
Date: 2001-11-20 08:07:56
Message-ID: 20011120000343.G53451-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 19 Nov 2001, Tom Lane wrote:

> <cnliou(at)eurosport(dot)com> writes:
> > Am I asking for too much, or RI and triggers were not
> > designed for operations like this example in the
> > first place?
>
> The problem is that RI is implemented by triggers, and there's
> no guarantees about the firing order of multiple triggers.
> So you don't know whether your custom triggers will fire
> before or after the RI actions occur.

Even specifying the after trigger order wouldn't help him
I think. He'd want the deletion of the details rows and their
associated triggers to run before the actual deletion of the
master row. I'd guess that would require the cascade delete
to be being done as a before delete trigger.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-11-20 08:09:26 Re: Foreign Key Constraint Deletion Order
Previous Message Roland Roberts 2001-11-20 05:00:22 Re: [DOCS] PL/pgSQL examples NOT involving functions