pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Victor Yegorov <vyegorov@gmail.com>
Cc: Pierre Forstmann <pierre.forstmann@gmail.com>
Subject: Re: Unexpected results from CALL and AUTOCOMMIT=off
Date: Tue, 4 Jun 2024 15:13:12 -0500
Message-ID: <Zl91WPpX2KElTZbb@nathan> (raw)
In-Reply-To: <538151.1717525723@sss.pgh.pa.us>
References: <CAGnEboiRe+fG2QxuBO2390F7P8e2MQ6UyBjZSL_w1Cej+E4=Vw@mail.gmail.com>
	<CAM-sOH80Z=OqYBWgYP=BDGLbxQ72wkC9=tZ-vRKxkmKkhTD7MQ@mail.gmail.com>
	<CAGnEbojf5Awm862ghvooLku6mm0m4yF60PyHQxCinM8pn01sbw@mail.gmail.com>
	<90052.1717442890@sss.pgh.pa.us>
	<378291.1717464748@sss.pgh.pa.us>
	<538151.1717525723@sss.pgh.pa.us>

On Tue, Jun 04, 2024 at 02:28:43PM -0400, Tom Lane wrote:
> Actually, after poking around some more I found that there *is* a way
> to deal with this within spi.c: we can make _SPI_execute_plan ignore
> options->allow_nonatomic unless the SPI_OPT_NONATOMIC flag was given
> when connecting.
> 
> I like this better than my first solution because (a) it seems to
> make the allow_nonatomic flag behave in a more intuitive way;
> (b) spi.c gates some other behaviors on SPI_OPT_NONATOMIC, so that
> gating this one too seems more consistent, and (c) this way, we fix
> not only plpgsql but anything that has copied its coding pattern.

+1

> Hence, new patch attached, now with docs and tests.  Barring
> objections I'll push this one.

Should we expand the documentation for SPI_connect_ext() to note that
SPI_execute_extended()/SPI_execute_plan_extended() depend on the flag?

-- 
nathan





view thread (8+ messages)  latest in thread

Message-ID: <Zl91WPpX2KElTZbb@nathan>
Permalink:  ../Zl91WPpX2KElTZbb@nathan/
Also on:    postgresql.org/message-id/Zl91WPpX2KElTZbb@nathan

 · 

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: pgsql-general@postgresql.org
  Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com, vyegorov@gmail.com, pierre.forstmann@gmail.com
  Subject: Re: Unexpected results from CALL and AUTOCOMMIT=off
  In-Reply-To: <Zl91WPpX2KElTZbb@nathan>

* 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