17th September 2020: PostgreSQL 13 RC 1 Released!
Supported Versions: Current (12) / 11
Development Versions: 13 / devel
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the supported versions listed above instead.


SPI_start_transaction — start a new transaction


void SPI_start_transaction(void)


SPI_start_transaction starts a new transaction. It can only be called after SPI_commit or SPI_rollback, as there is no transaction active at that point. Normally, when an SPI-using procedure is called, there is already a transaction active, so attempting to start another one before closing out the current one will result in an error.

This function can only be executed if the SPI connection has been set as nonatomic in the call to SPI_connect_ext.