Re: SPI isolation changes - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: SPI isolation changes
Date
Msg-id b5eacfb7-ea65-64c2-1a5a-459341ee16b7@iki.fi
Whole thread Raw
In response to SPI isolation changes  (Seino Yuki <seinoyu@oss.nttdata.com>)
Responses Re: SPI isolation changes
List pgsql-hackers
On 30/06/2023 17:15, Seino Yuki wrote:
> Hi,
> 
> When I read the documents and coding of SPI, [1]
> I found that the following the SPI_start_transaction does not support
> transaciton_mode(ISOLATION LEVEL, READ WRITE/READ ONLY) like BEGIN
> command. [2]
> Is there a reason for this?

Per the documentation for SPI_start_transaction that you linked to:

"SPI_start_transaction does nothing, and exists only for code 
compatibility with earlier PostgreSQL releases."

I haven't tested it, but perhaps you can do "SET TRANSACTION ISOLATION 
LEVEL" in the new transaction after calling SPI_commit() though. Or "SET 
DEFAULT TRANSACTION ISOLATION LEVEL" before committing.

-- 
Heikki Linnakangas
Neon (https://neon.tech)




pgsql-hackers by date:

Previous
From: Karina Litskevich
Date:
Subject: Re: Avoid unused value (src/fe_utils/print.c)
Next
From: Seino Yuki
Date:
Subject: Re: SPI isolation changes