Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order

From: David Pufer <david(dot)pufer(at)7data(dot)eu>
To: pgsql-docs(at)postgresql(dot)org
Subject: Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order
Date: 2007-04-21 16:02:13
Message-ID: 462A3585.9060400@7data.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Michael Glaesemann wrote:
>
> On Apr 21, 2007, at 4:39 , David Pufer wrote:
>
>> In my opinion it would be nice to mention in SQL reference commands that
>> constraint triggers created by CREATE CONSTRAINT TRIGGER are fired in
>> creation order unlike regular triggers created by command CREATE
>> TRIGGER. As I know, the firing order of the CONSTRAINT TRIGGER is
>> determined by the XXXXX num at "RI_ConstraintTrigger_XXXXX" column in
>> pg_trigger table.
>
> I believe this just falls out of the normal order of trigger firing as
> explained in the CREATE TRIGGER documentation
> (http://www.postgresql.org/docs/8.2/interactive/sql-createtrigger.html)
>
>> If multiple triggers of the same kind are defined for the same event,
>> they will be fired in alphabetical order by name.
>
> It might be nice to add a similar phrase to the CREATE CONSTRAINT
> TRIGGER documentation, but as far as I know, the behavior is the same
> for triggers created by either method. The only difference is that
> constraint triggers are named by the system rather than by the user.
>
> Thoughts?
>
> Michael Glaesemann
> grzm seespotcode net
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

You are right. Thanks for the note of system name that are assigned by
the server by incrementing the num at "RI_ConstraintTrigger_NUM" at each
constraint trigger creation.

Regards,
David Pufer

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2007-04-21 16:20:40 Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order
Previous Message Michael Glaesemann 2007-04-21 12:44:52 Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order