Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 8FAA59FB59B for ; Sat, 21 Apr 2007 13:02:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 13012-05-5 for ; Sat, 21 Apr 2007 13:02:34 -0300 (ADT) X-Greylist: delayed 06:22:53.055575 by SQLgrey-1.7.4 Received: from mailfilter1.7data.eu (82-100-4-5.net.maiva.cz [82.100.4.5]) by postgresql.org (Postfix) with ESMTP id DADFD9FB489 for ; Sat, 21 Apr 2007 13:02:15 -0300 (ADT) Received: from mailfilter1.7data.eu (localhost [127.0.0.1]) by sagator.mailfilter1.7data.eu (Postfix) with ESMTP id 0B822499B45 for ; Sat, 21 Apr 2007 18:02:14 +0200 (CEST) X-Sagator-Scanner: 0.8.1-1 at 7drouter1; log(status(quarantine(drop(stream2mbox(libclam())))), status(quarantine(drop(SpamAssassinD())))) X-Sagator-ID: 20070421-180213-0001-13838-420rYf@7drouter1 Received: from [192.168.100.100] (unknown [192.168.100.100]) by mailfilter1.7data.eu (Postfix) with ESMTP id EC47C499B43 for ; Sat, 21 Apr 2007 18:02:13 +0200 (CEST) Message-ID: <462A3585.9060400@7data.eu> Date: Sat, 21 Apr 2007 18:02:13 +0200 From: David Pufer User-Agent: Thunderbird 2.0.0.0 (X11/20070420) MIME-Version: 1.0 To: pgsql-docs@postgresql.org Subject: Re: Improving CREATE CONSTRAINT TRIGGER documentation - trigger firing order References: <4629DBC8.4010700@7data.eu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/21 X-Sequence-Number: 4217 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