SPI_FINISH(3)

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

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