SPI_COMMIT(3)

πŸ“¦ version 17.11, in opensuse-leap 16.0

πŸ’… 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