Re: Consider pipeline implicit transaction as a transaction block

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Consider pipeline implicit transaction as a transaction block
Date: 2024-10-30 15:06:20
Message-ID: CAGECzQQG658yCZZ6S4sU=bu3H7ykf4ZpYzRCBJt0U3cVi3818A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 30 Oct 2024 at 10:15, Anthonin Bonnefoy
<anthonin(dot)bonnefoy(at)datadoghq(dot)com> wrote:
> The attached patch adds the detection of implicit transactions started
> by a pipeline in CheckTransactionBlock, avoiding warnings when
> commands like `set local` are called within a pipeline, and making the
> detection of transaction block coherent with what's done in
> IsInTransactionBlock and PreventInTransactionBlock.

+1 seems like a reasonable change.

> The XACT_FLAGS_PIPELINING will only be set after the first command, so
> the warning about `set local` happening outside of a transaction block
> will still be generated. However, I'm not sure if it's something
> fixable (or worth fixing?). This would require to know beforehand that
> there are multiple executes before the sync message, which doesn't
> seem doable.

Yeah, I don't really see a way around that apart from not throwing
this warning at all when the client is using the extended protocol.
Postgres would need to be clairvoyant to know to really know if it
should show it for the first message.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-10-30 15:08:52 Re: [17] CREATE SUBSCRIPTION ... SERVER
Previous Message Junwang Zhao 2024-10-30 14:41:40 Re: general purpose array_sort