On Wed, 30 Oct 2024 at 10:15, Anthonin Bonnefoy
<anthonin.bonnefoy@datadoghq.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.