Re: Does a 'stable' deferred trigger execution order exist? - Mailing list pgsql-general

From Gaetano Mendola
Subject Re: Does a 'stable' deferred trigger execution order exist?
Date
Msg-id 41211972.1080802@bigfoot.com
Whole thread Raw
In response to Re: Does a 'stable' deferred trigger execution order exist?  (Frank van Vugt <ftm.van.vugt@foxi.nl>)
Responses Re: Does a 'stable' deferred trigger execution order exist? -> answer: yes  (Frank van Vugt <ftm.van.vugt@foxi.nl>)
List pgsql-general
Frank van Vugt wrote:

>>>If during a transaction a number of deferred triggers are fired, what
>>>will be their execution order upon the commit?
>
>
>>Should be alphabetical within each triggering event, IIRC.
>
>
> Mmm, yes, but are all the deferred triggers on the same event 'grouped'?
>
> What I'm thinking about is something like:
>
>
> BEGIN;
>     update foo1;        => triggers deferred after insert trigger 'Z'
>     select bar;
>     update foo2;        => triggers deferred after insert triggers 'B' and 'A'
> COMMIT;
>
>
> Now, will I see an execution order of 'Z-A-B' (on alfabet per event per
> statement) or 'A-B-Z' (on alfabet per event per transaction)??
>
> For what I want to accomplish, I don't care about the order of A/B, but
> together they depend on the work that is done by the earlier triggered Z.

The best way is to "raise notice" inside the trigger function and observe
the results


Regards
Gaetano Mendola




pgsql-general by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: Thousands of parallel connections
Next
From: Manuel Sugawara
Date:
Subject: Re: PostgreSQL 8.0 Feature List?