Re: Unexpected results from CALL and AUTOCOMMIT=off

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Victor Yegorov <vyegorov(at)gmail(dot)com>, Pierre Forstmann <pierre(dot)forstmann(at)gmail(dot)com>
Subject: Re: Unexpected results from CALL and AUTOCOMMIT=off
Date: 2024-06-04 20:13:12
Message-ID: Zl91WPpX2KElTZbb@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2024-06-04 20:31:34 Re: Unexpected results from CALL and AUTOCOMMIT=off
Previous Message Gavin Roy 2024-06-04 19:47:22 Re: Purpose of pg_dump tar archive format?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-06-04 20:31:34 Re: Unexpected results from CALL and AUTOCOMMIT=off
Previous Message Nathan Bossart 2024-06-04 19:39:23 use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade