From: | Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Does a 'stable' deferred trigger execution order exist? -> answer: yes |
Date: | 2004-08-17 08:25:53 |
Message-ID: | 200408171025.53967.ftm.van.vugt@foxi.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Ulrich Wisser | 2004-08-17 08:34:05 | Re: major database breakdown |
Previous Message | My Thi Ho | 2004-08-17 07:43:25 | multimedia on postgresql |