SPI_COMMIT(3)
π SPI_COMMIT π
okay so bestie, welcome to the PostgreSQL 17.11 docs, and specifically to the SPI_COMMIT(3) page β aka the one where you learn how to say "we're SO done here" to a transaction. it's giving commit energy, and honestly? iconic. β¨
πΈ NAME πΈ
SPI_commit, SPI_commit_and_chain β commit the current transaction π
π¦ SYNOPSIS π¦
void SPI_commit(void)
void SPI_commit_and_chain(void)
no arguments, no return value, just vibes and a void. we love a low-maintenance signature. π
β¨ DESCRIPTION β¨
So SPI_commit commits the current transaction. Fr fr, it's approximately equivalent to running the SQL command COMMIT β like, same energy, same outcome.
Here's the cute part: after the transaction is committed, a new transaction is automatically started using default transaction characteristics, so you (the caller) can keep on using SPI facilities without missing a beat. main character continuity, honestly. π«Ά
But bestie, listen β if there is a failure during commit, the current transaction is instead rolled back and a new transaction is started, and then the error is thrown in the usual way. so it's not a silent L, the error still shows up like it should. π
ngl, that rollback-then-restart-then-throw flow is a whole journey, but that's exactly what it does. no cap.
SPI_commit_and_chain is the same thing, but the new transaction is started with the same transaction characteristics as the just finished one β exactly like the SQL command COMMIT AND CHAIN. it's giving "we're staying in the same outfit, just a new transaction." π₯
β οΈ Real talk: these functions can ONLY be executed if the SPI connection has been set as nonatomic in the call to SPI_connect_ext. like, that's the vibe check you have to pass first. no nonatomic, no commit. periodt. π
π SEE ALSO π
hmm, there's no SEE ALSO section on this one bestie β the page just ends after DESCRIPTION. sometimes less is more, and honestly? slay. π
and that's the whole page, bestie β you ate. π
PostgreSQL 17.11 Β· dated 2026 Β· SPI_COMMIT(3) β mwah, go commit something ππ§β
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17-docs 17.11-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