Re: What Is The Firing Order?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What Is The Firing Order?
Дата
Msg-id 22866.999872760@sss.pgh.pa.us
обсуждение исходный текст
Ответ на What Is The Firing Order?  (<cnliou@eurosport.com>)
Ответы Re: What Is The Firing Order?
Re: What Is The Firing Order?
Re: What Is The Firing Order?
Список pgsql-general
<cnliou@eurosport.com> writes:
> The document says: "Also, if more than one trigger is
> defined for the same event on the same relation, the
> order of trigger firing is unpredictable.

Yup, and it means what it says.

> My another question is: When both UPDATE trigger (and
> its trigger function) and UPDATE CASCADE constraint
> are both defined, is the custom UPDATE trigger or the
> UPDATE CASCADE constraint fired first?

> I wish the constraint will be fired first.

That seems fairly arbitrary; someone else might wish the opposite,
depending on the details of what they want to do.

If we were to modify the code to make the firing order predictable,
I'd want it to be user-controllable.  A simple hack that comes to
mind is to fire triggers in alphabetical order by name --- then you
can easily arrange for custom triggers to fall either before or after
system-generated ones.  But perhaps someone else has a better idea.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Andrew Gould
Дата:
Сообщение: Re: Great Bridge ceases operations
Следующее
От: "Roderick A. Anderson"
Дата:
Сообщение: Idea: jobs.postgresql.org