Re: Trigger Firing Order - Mailing list pgsql-general

From Tom Lane
Subject Re: Trigger Firing Order
Date
Msg-id 3178.1386736281@sss.pgh.pa.us
Whole thread Raw
In response to Trigger Firing Order  (Sameer Kumar <sameer.kumar@ashnik.com>)
Responses Re: Trigger Firing Order  (Sameer Kumar <sameer.kumar@ashnik.com>)
List pgsql-general
Sameer Kumar <sameer.kumar@ashnik.com> writes:
> Is it possible for me to define the order in which triggers will be fired?

Sure: choose their names so that their alphabetical ordering is the
firing order you want.  But I see you knew that.

> But with certain packaged products who create their own triggers, I won't
> have control over this.

I don't have a lot of sympathy for that argument.  If the product is
capable of creating Postgres-compatible triggers at all, it should be
aware that the name is a significant property, and hence provide some
mechanism for selecting a name.  Even if it somehow forgot about the
firing-order property, you can't seriously claim that it's our problem
to cater for combinations of client-side code that each think they can
choose trigger names in a vacuum.  What if they choose the same name?

> Also, this could be an issue for me if I write
> business logic in triggers.

This statement lacks content.  What problem do you foresee, and what
other ordering rule would you like that doesn't work about as well
as the name rule?

            regards, tom lane


pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Trigger Firing Order
Next
From: Dev Kumkar
Date:
Subject: Case sensitivity