Re: Does a 'stable' deferred trigger execution order exist? -> answer: yes

Поиск
Список
Период
Сортировка
От Frank van Vugt
Тема Re: Does a 'stable' deferred trigger execution order exist? -> answer: yes
Дата
Msg-id 200408171025.53967.ftm.van.vugt@foxi.nl
обсуждение исходный текст
Ответ на Re: Does a 'stable' deferred trigger execution order exist? -> answer: yes  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Does a 'stable' deferred trigger execution order exist? -> answer: yes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> > deferred triggers are always executed in the order they fired
> > for one and the same event, they will execute in order of definition

> "Order in which they were defined"?  Hmm, I thought we had agreed long
> since to trigger these things in alphabetical order.  Something is wrong
> here.

All 'plain' triggers on one and the same event are indeed triggered in
alphabetical order. It's the deferred triggers that aren't, not for the set
of triggers on one event and not for the complete collection of triggers for
that transaction.


Allow me to repeat and possibly clarify an earlier (personal) point of
interest:

Any execution order for regular triggers would be as good as any other, given
the fact that it is a single atomic event that triggered them, a design
should not try to make use of a specific order. The same goes for deferred
triggers that fired on the same event, the particular order of trigger
execution within this set should not be of any interest.

However, the accumulated collection of deferred triggers at the end of a
transaction possibly exists of many sets, each of which was fired on a
different event, on a different point in time. Therefore, IMHO, it is
possible for a dependancy between certain sets to be valid and handled
properly by the fact that at least the sets itself are executed in the same
order as the original events they fired upon.

So, the one thing that would make me unhappy here is when the complete
collection of triggers would simply be executed in alphabetical order. And
since I'd obviously like to make use of the earlier described dependancies
between trigger-sets, I'm a bit cautious regarding a possible 'silent change
in behaviour' between versions.




--
Best,




Frank.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Does a 'stable' deferred trigger execution order exist? -> answer: yes
Следующее
От: Ulrich Wisser
Дата:
Сообщение: Re: major database breakdown