On Mon, Nov 04, 2024 at 10:42:36AM +0100, Anthonin Bonnefoy wrote:
> This allows the removal of the XACT_FLAGS_PIPELINING check in
> IsInTransactionBlock and PreventInTransactionBlock since the
> transaction state will correctly reflect the ongoing implicit block.
> Additionally, it will reuse the same behaviour with regard to
> SAVEPOINT and disallow them with a "SAVEPOINT can only be used in
> transaction blocks" error.

Ah, interesting.  I did not notice this bit in DefineSavepoint().  So
that would be the path that we would bump on for an error as
TBLOCK_IMPLICIT_INPROGRESS would not be set, based on the fact that
it does not really make sense to come back to a previous state while
we are in a pipeline.

It would be nice to document all these behaviors with regression
tests in pgbench as it is the only place where we can control that
with error pattern checks.  Let's say:
- LOCK in first position of a pipeline fails, works on follow-up
commands. 
- Some command not allowed in transaction blocks, like a REINDEX
CONCURRENTLY or similar?
- One part with the SET LOCAL portion of the problem, where we don't
have a hard error on the first command in this case.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to