public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Anthonin Bonnefoy <[email protected]>
Cc: Jelte Fennema-Nio <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Tom Lane <[email protected]>
Subject: Re: Consider pipeline implicit transaction as a transaction block
Date: Tue, 5 Nov 2024 14:50:06 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAO6_Xqq70__5pnWTf0hqE4gYsACNWYxzRUhikws6J3dK1cau9A@mail.gmail.com>
References: <CAO6_XqrWO8uNBQrSu5r6jh+vTGi5Oiyk4y8yXDORdE2jbzw8xw@mail.gmail.com>
	<CAGECzQQG658yCZZ6S4sU=bu3H7ykf4ZpYzRCBJt0U3cVi3818A@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CAO6_Xqq70__5pnWTf0hqE4gYsACNWYxzRUhikws6J3dK1cau9A@mail.gmail.com>

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


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (4+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Consider pipeline implicit transaction as a transaction block
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox