Re: SPI isolation changes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Seino Yuki <seinoyu(at)oss(dot)nttdata(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: SPI isolation changes
Date: 2023-06-30 16:47:10
Message-ID: 1770512.1688143630@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Seino Yuki <seinoyu(at)oss(dot)nttdata(dot)com> writes:
> Of course, executing SET TRANSACTION ISOLATION LEVEL with SPI_execute
> will result in error.
> ---
> SPI_execute("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE", false, 0);

> (Log Output)
> ERROR: SET TRANSACTION ISOLATION LEVEL must be called before any query
> CONTEXT: SQL statement "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"

Even if you just did SPI_commit? That *should* fail if you just do
it right off the bat in a SPI-using procedure, because you're already
within the transaction that called the procedure. But I think it
will work if you do SPI_commit followed by this SPI_execute.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2023-06-30 17:32:50 Re: ProcessStartupPacket(): database_name and user_name truncation
Previous Message Seino Yuki 2023-06-30 16:21:35 Re: SPI isolation changes