From: Tom Lane <tgl@sss.pgh.pa.us>
To: rbiro@interfacefinancial.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16705: Triggers deferred during commit callback are not executed
Date: Fri, 06 Nov 2020 09:49:58 -0500
Message-ID: <1570376.1604674198@sss.pgh.pa.us> (raw)
In-Reply-To: <16705-f34c72116d9b2174@postgresql.org>
References: <16705-f34c72116d9b2174@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> If you register a function with RegisterXactCallback that causes a trigger
> to be deferred, that trigger is never executed.
I'd say that's in the category of "conceptually ridiculous".
The PRE_COMMIT events are supposed to fire after all user-level
actions in the transaction are finished. Running a trigger that
could do arbitrary things would certainly break the assumptions of
whatever processing people might be doing in PRE_COMMIT callbacks.
Perhaps there's a use case for an even earlier callback that runs in or
before the fire-deferred-triggers loop. But you haven't made any argument
for it, so I'm loath to add more complexity and cycles to transaction
commit for this. The whole area is quite tricky --- for instance, the
interaction with cursor closing is not something that would leap to mind.
So it's not obvious that such a callback could do anything useful and
bulletproof.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rbiro@interfacefinancial.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16705: Triggers deferred during commit callback are not executed
In-Reply-To: <1570376.1604674198@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox