Re: Firing Orders - Mailing list pgsql-general

From Tom Lane
Subject Re: Firing Orders
Date
Msg-id 14073.1038496496@sss.pgh.pa.us
Whole thread Raw
In response to Firing Orders  ("CN" <cnliou9@fastmail.fm>)
List pgsql-general
"CN" <cnliou9@fastmail.fm> writes:
> 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?

The RI_ triggers are AFTER triggers, so yes.

> 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?

Huh?  They would not be fired at all, at least not as part of the same
trigger event.

> 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?

When it says "alphabetical order", it means exactly that.  RI triggers
aren't special.

            regards, tom lane

pgsql-general by date:

Previous
From: "Shridhar Daithankar"
Date:
Subject: Re: Why does everyone think MySQL is easier?
Next
From: PostgreSQL Public Relations
Date:
Subject: PostgreSQL Global Development Group Announces Version 7.3