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