Re: Trigger Firing Order

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Trigger Firing Order
Дата
Msg-id 3178.1386736281@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Trigger Firing Order  (Sameer Kumar <sameer.kumar@ashnik.com>)
Ответы Re: Trigger Firing Order
Список 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 по дате отправления:

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: Trigger Firing Order
Следующее
От: Dev Kumkar
Дата:
Сообщение: Case sensitivity