On Tue, 7 Sep 2004, Tom Lane wrote:
> * EndQuery processes and discards immediate-mode AFTER trigger events for the
> current query. Any remaining events (ie, DEFERRED triggers) are appended
> to the current (sub)transaction's list of pending deferred triggers.
> Note that even inside a subtransaction, we can discard immediate-mode
> events.
>
> * EndXact and DeferredTriggerSetState continue to act the same as before.
> In particular, DeferredTriggerSetState need pay no attention to trigger
> events that are still in lists belonging to open queries; those events
> aren't ready to fire yet.
>
> Comments?
If I'm reading the above correctly, I think DeferredTriggerSetState may
need to change a little if EndQuery works on a separate list of triggers
because I believe set constraints immediate currently depends on EndQuery
going over the entire list of saved deferred triggers.