SPI_FINISH(3)
π SPI_FINISH(3) π
okay bestie, gather round β this is the PostgreSQL 18.6 manual page for SPI_finish, and it's literally the "okay bye, love u" of the SPI world π«Ά
β¨ NAME β¨
SPI_finish β disconnect a C function from the SPI manager π
β¨ SYNOPSIS β¨
int SPI_finish(void)
β¨ DESCRIPTION β¨
SPI_finish closes an existing connection to the SPI manager. Think of it as hanging up the phone β you opened the line, you did your little chat, now you gotta end the call, bestie ππ
You must call this function after you finish all the SPI operations you needed during your C function's current invocation. No leaving it on read. No ghosting the SPI manager. It's giving rude and it's giving broken. π
BUT β and this is the good part β you do not need to worry about making that happen if you abort the transaction via elog(ERROR). In that case SPI will clean itself up automatically. Self-care king behavior, honestly. β¨π§
fr fr: normal exit β you callSPI_finish. Error abort viaelog(ERROR)β SPI handles it itself, you don't gotta do a thing. πΈ
β¨ RETURN VALUE β¨
SPI_OK_FINISHβ if properly disconnected π (the slay outcome, the one you want)SPI_ERROR_UNCONNECTEDβ if called from an unconnected C function π (you tried to hang up a phone that was never picked up)
and that's the whole page, no cap. every option, every return value, every vibe β accounted for. periodt. π
signing off from the PostgreSQL 18.6 docs, dated 2026 β same manual, same facts, just with infinitely more main character energy πβ¨ππ¦
π¦ 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