Subject: Re: SPI isolation changes

From: Heikki Linnakangas <[email-masked]>
Date: Fri, 30 Jun 2023 17:26:57 +0300

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)