SPI_COMMIT(3)
π SPI_COMMIT(3) β the PostgreSQL 18.6 glow-up edition β¨
okay bestie, sit down, hydrate, and let's talk about committing transactions π this one lives in the PostgreSQL 18.6 docs and honestly? it's giving "short but life-changing."
πΈ NAME πΈ
SPI_commit, SPI_commit_and_chain β commit the current transaction, periodt π
π SYNOPSIS π
void SPI_commit(void)
void SPI_commit_and_chain(void)
like. that's it. two little functions. no arguments. iconic behavior fr fr β¨
π¦ DESCRIPTION π¦
so SPI_commit commits the current transaction. think of it as approximately the same vibe as running the SQL command COMMIT β not identical, but basically the same energy π«
the way that it works: 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. she's self-sufficient, she's got main character energy π
β οΈ but 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 all sparkles β sometimes she stumbles, but she always recovers and tells you what went wrong π
now SPI_commit_and_chain is the same thing, EXCEPT the new transaction is started with the same transaction characteristics as the just finished one β just like with the SQL command COMMIT AND CHAIN. same fit, new transaction. she's recycling the aesthetic π₯
π the one rule, the vibe check, the non-negotiable π
these functions can only be executed if the SPI connection has been set as nonatomic in the call to SPI_connect_ext.
read that again, bestie. only. if your connection isn't nonatomic, this whole thing is a no. set it up right or don't come to the party π«π
π SEE ALSO π
no extra references on this one β she stands alone. lowkey iconic of her π«Ά
and that's the whole page! written up for PostgreSQL 18.6 in 2026 β mwah, sending you good commit vibes and zero unexpected rollbacks ππβ¨
π¦ where this page comes from
- alpine 3.23: postgresql18-doc 18.6-r0 Β· PostgreSQL
- alpine 3.24: postgresql18-doc 18.6-r0 Β· PostgreSQL
- arch rolling: postgresql 18.6-4 Β· PostgreSQL
- fedora 43: postgresql-server-devel 18.6-1.fc43 Β· PostgreSQL
- fedora 43: postgresql-server-devel 18.6-1.fc43 Β· PostgreSQL
- fedora 44: postgresql-server-devel 18.6-1.fc44 Β· PostgreSQL
- fedora 44: postgresql-server-devel 18.6-1.fc44 Β· PostgreSQL
- nixos 26.05: postgresql 18.6
- ubuntu resolute: postgresql-doc-18 18.6-0ubuntu0.26.04.1 Β· PostgreSQL
- ubuntu stonking: postgresql-doc-18 18.6-3build2 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms