Firing Orders - Mailing list pgsql-general

From CN
Subject Firing Orders
Date
Msg-id 20021128121843.C52B73AF1D@server2.fastmail.fm
Whole thread Raw
Responses Re: Firing Orders  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Firing Orders  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Hi!

The document reads:

"If more than one trigger is defined for the same event on the same
relation, the triggers will be fired in alphabetical order by name."

Q1. Are BEFORE UPDATE and BEFORE DELETE (let's call them as "customed")
triggers always fired before RI_ConstraintTriggers on the same relation
regardless of the alphabetical name of these customed triggers?

Q2. Are BEFORE UPDATE and BEFORE DELETE (customed) triggers on the
referenced relation fired before the RI_ConstraintTriggers on the
referencing relation regardless of the alphabetical name of these
customed triggers?

Q3. Are AFTER UPDATE and AFTER DELETE (customed) triggers fired after
RI_ConstraintTriggers on the same relation regardless of the alphabetical
name of these customed triggers?

Q4. Are AFTER UPDATE and AFTER DELETE (customed) triggers on the
referenced relation fired after the RI_constraintTriggers on the
referencing relation regardless of the alphabetical name of these
customed triggers?

It might be a good idea to add matrix tables with explaining

(1) triggers' firing orders when BEFORE and AFTER are involved like the
aformentioned questions
(2) UPDATE and DELETE order between the referenced (master) and the
referencing (detail) tables when RI constraints are enforced between the
two

to programmer's manual as I feel programmers may fail to maintain their
data in integrity if they lose the control over these "orders".

Regards,

CN
--
http://fastmail.fm - The way an email service should be

pgsql-general by date:

Previous
From: Christoph Dalitz
Date:
Subject: Re: German character set
Next
From: Jean-Christian Imbeault
Date:
Subject: Re: Whereis the pltcl.so file for postgres7.2.3??