Re: SPI isolation changes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SPI isolation changes
Date
Msg-id 1758726.1688137575@sss.pgh.pa.us
Whole thread Raw
In response to Re: SPI isolation changes  (Seino Yuki <seinoyu@oss.nttdata.com>)
Responses Re: SPI isolation changes
List pgsql-hackers
Seino Yuki <seinoyu@oss.nttdata.com> writes:
> 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?

I think you're trying to get us to undo commit 2e517818f, which
is not going to happen.  See the threads that led up to that:

Discussion: https://postgr.es/m/3375ffd8-d71c-2565-e348-a597d6e739e3@enterprisedb.com
Discussion: https://postgr.es/m/17416-ed8fe5d7213d6c25@postgresql.org

It looks to me like you can just change the transaction property
settings immediately after SPI_start_transaction if you want to.
Compare this bit in SnapBuildExportSnapshot:

    StartTransactionCommand();

    /* There doesn't seem to a nice API to set these */
    XactIsoLevel = XACT_REPEATABLE_READ;
    XactReadOnly = true;

Also look at the implementation of SPI_commit_and_chain,
particularly RestoreTransactionCharacteristics.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Assert !bms_overlap(joinrel->relids, required_outer)
Next
From: Heikki Linnakangas
Date:
Subject: On /*----- comments