SPI_COMMIT(3)
π NAME π
Okay bestie, welcome to SPI_COMMIT(3) β the page all about SPI_commit and SPI_commit_and_chain, aka the functions that commit the current transaction. Slay. β¨
π SYNOPSIS π
void SPI_commit(void)
void SPI_commit_and_chain(void)
πΈ DESCRIPTION πΈ
So SPI_commit commits the current transaction. Itβs approximately equivalent to running the SQL command COMMIT. No cap. π
After the transaction is committed, a new transaction is automatically started using default transaction characteristics, so that the caller can keep using SPI facilities. Iconic, honestly. π¦
But listen β if there is a failure during commit, the current transaction is instead rolled back and a new transaction is started, after which the error is thrown in the usual way. So itβs giving βcommit, but make it resilient.β πβ¨
SPI_commit_and_chain is the same, but the new transaction is started with the same transaction characteristics as the just finished one, like with the SQL command COMMIT AND CHAIN. Periodt. π₯
Heads up, bestie: these functions can only be executed if the SPI connection has been set as nonatomic in the call to SPI_connect_ext. Thatβs the vibe check you gotta pass first. π«Ά
Written for PostgreSQL 13.23, dated 2025 β mwah, sheβs iconic, sheβs documented, sheβs logging off. ππβ¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13-docs 13.23-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms