Firing Orders

From: "CN" <cnliou9(at)fastmail(dot)fm>
To: pgsql-general(at)postgresql(dot)org
Subject: Firing Orders
Date: 2002-11-28 12:18:43
Message-ID: 20021128121843.C52B73AF1D@server2.fastmail.fm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Christian Imbeault 2002-11-28 12:26:26 Re: Whereis the pltcl.so file for postgres7.2.3??
Previous Message Christoph Dalitz 2002-11-28 12:13:59 Re: German character set