Re: Trigger Firing Order - Mailing list pgsql-general

From David Johnston
Subject Re: Trigger Firing Order
Date
Msg-id 1386735961381-5782800.post@n5.nabble.com
Whole thread Raw
In response to Trigger Firing Order  (Sameer Kumar <sameer.kumar@ashnik.com>)
List pgsql-general
Sameer Kumar wrote
> Hi,
>
> Is it possible for me to define the order in which triggers will be fired?
>
> So far what I have understood from PostgreSQL documentation, in order to
> fire 2 triggers in sequence (say trigger1 and trigger2) on a table, I need
> to name them in that way.
> But with certain packaged products who create their own triggers, I won't
> have control over this. Also, this could be an issue for me if I write
> business logic in triggers.
>
> Any better way known to work in PostgreSQL?

If you have sufficient enough rights on the database you can modify the
triggers in whatever way you deem fit.  There is currently no alternative
way to specify trigger execution order than alphabetically.

I guess such re-naming could introduce problems with applications but that
is unlikely.

Note, too, that you can leave but disable the existing triggers and define
your own triggers with whatever name you require and simply call the same
function as the existing trigger.

Is this a theoretical question or do you actual have this problem?

David J.





--
View this message in context: http://postgresql.1045698.n5.nabble.com/Trigger-Firing-Order-tp5782797p5782800.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [Postgres-xc-general] "Tuple not found error" during Index creation
Next
From: Tom Lane
Date:
Subject: Re: Trigger Firing Order