SPI_FINISH(3)
π NAME π
okay bestie, welcome to SPI_FINISH(3) from the PostgreSQL 14.24 documentation β¨ β this is the page for SPI_finish, aka the function that disconnects a C function from the SPI manager π«Ά
β¨ SYNOPSIS β¨
int SPI_finish(void)
π¦ DESCRIPTION π¦
So SPI_finish closes an existing connection to the SPI manager. iconic cleanup behavior, no cap π
You must call this function after completing the SPI operations needed during your C functionβs current invocation. like, thatβs the assignment, bestie π
But lowkey? You do not need to worry about making this happen if you abort the transaction via elog(ERROR). in that case, SPI will clean itself up automatically πβ¨
π RETURN VALUE π
SPI_OK_FINISHβ if properly disconnected. slay, the connection is closed correctly πSPI_ERROR_UNCONNECTEDβ if called from an unconnected C function. oop, there was no connection to begin with π
xoxo, bestie π«Ά this little page is serving PostgreSQL 14.24, dated 2026, and itβs still SPI_FINISH(3) π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14-docs 14.24-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