Re: Controling Rule's Firing Order - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Controling Rule's Firing Order
Date
Msg-id 20020825203515.I55041-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Controling Rule's Firing Order  (<cnliou@eurosport.com>)
List pgsql-general
On Mon, 26 Aug 2002 cnliou@eurosport.com wrote:

> Thank you! Alvaro and Stephan,
>
> > The name of a foreign key trigger is a constant
> > beginning followed by an oid.
>
> Now I think I have found that FK trigger names look
> like this:
>
> RI_ConstraintTrigger_<OID>
>
> > but you should be able to make triggers run
> > before/after the foreign key trigger by picking
> > names before/after the constant part of the
> > fk trigger name.
>
> Yes, this is the way for me to go. The last missing
> better-have feature is the firing order among FK
> triggers for master and detail tables:
>
> - When the primary key of master record is to be
> updated, the primary key of this master record is
> updated before those of its child records.

If you mean, upon an update of master record, the update occurs
before the referential action, this should already be true
since it's an after trigger.

> - When the master record is to be deleted, its detail
> records are first deleted.

Unless we've misread the spec (which is possible) the above
does not comply with the foreign key specification.  There
are disagreements about when the referential action should
occur, but the earliest anyone's found justification for
is upon marking a row for deletion the detail rows are marked
for deletion (we currently actually do it after this point
because we don't have an agreement as to what some of the phrases
mean).



pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Solved! MacOS X and external functions
Next
From: Christoph Dalitz
Date:
Subject: Re: TCL RPM for Windows