Re: Trigger Firing Order

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL General Discussion Forum <pgsql-general(at)postgresql(dot)org>
Subject: Re: Trigger Firing Order
Date: 2013-12-11 15:48:20
Message-ID: 1386776900.86253.YahooMailNeo@web162901.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com> wrote:

> If I have a trigger which add primary key to my inserted row
> ("before trigger"). Now if I plan to create new set of triggers
> for AUDITING or replication (where either I have no flexibility
> of choosing a name or the trigger name has to follow a standard),
> then I need to change all my existing triggers and rename them.

You have auditing or replication triggers that fire as BEFORE
triggers?  What do they do if a subsequent trigger further modifies
the operation before the statement is applied to the database?
(Obviously, all BEFORE triggers fire before the statement is
applied, and all AFTER triggers fire after the statement is
applied, so naming can never cause an AFTER trigger to fire before
a BEFORE trigger.)

> I was going to propose to work on developing an additional clause
> "ORDER n" for CREATE TRIGGER statement. Triggers with lowest
> order gets called first.

I just include a 3 digit number as part of my trigger names.  Why
is that harder than adding a new clause to the CREATE TRIGGER
statement?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-12-11 15:50:22 Re: Convert table to view 9.1
Previous Message salah jubeh 2013-12-11 15:29:25 Re: Convert table to view 9.1