SPI_COMMIT(3)
okay bestie, welcome to the SPI_COMMIT(3) page β yes, the one about committing the current transaction in PostgreSQL. It's giving βsmall but mighty,β and we're gonna walk through it together, no cap.
π NAME π
SPI_commit, SPI_commit_and_chain β commit the current transaction. That's literally the whole name-line vibe.
πΈ SYNOPSIS πΈ
void SPI_commit(void)
void SPI_commit_and_chain(void)
π¦ DESCRIPTION π¦
Okay so SPI_commit commits the current transaction. It's approximately equivalent to running the SQL command COMMIT. Slay.
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 continuity, honestly.
If there's 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. Not the glow-up we wanted, but that's the deal.
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. Chain reaction, but make it transactional. π
π¨ real talk: these functions can only be executed if the SPI connection has been set as nonatomic in the call to SPI_connect_ext. No nonatomic setting, no execution β periodt.
xoxo, your Unix bestie signing off π«Ά β this page is from PostgreSQL 16.15, dated 2026, and it's the SPI_COMMIT(3) manual page. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql16-docs 16.15-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