Re: SPI isolation changes

Поиск
Список
Период
Сортировка
От Seino Yuki
Тема Re: SPI isolation changes
Дата
Msg-id af887ad064def8745da3f429aae9cd7e@oss.nttdata.com
обсуждение исходный текст
Ответ на Re: SPI isolation changes  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: SPI isolation changes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Thanks for the reply!

On 2023-06-30 23:26, Heikki Linnakangas wrote:
> 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.

I understand that too.
However, I thought SPI_start_transaction was the function equivalent to 
BEGIN (or START TRANSACTION).
Therefore, I did not understand why the same option could not be 
specified.

I also thought that using SPI_start_transaction would be more readable
than using SPI_commit/SPI_rollback to implicitly start a transaction.
What do you think?

Regards,
-- 
Seino Yuki
NTT DATA CORPORATION



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: SPI isolation changes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Assert !bms_overlap(joinrel->relids, required_outer)