SPI_CONNECT(3)

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

πŸ’– NAME

SPI_connect, SPI_connect_ext β€” connect a C function to the SPI manager, bestie ✨

okay so this is the SPI_CONNECT(3) page from the PostgreSQL 16.15 Documentation, and it's giving very much "C extension main character energy" πŸŽ€


🌸 SYNOPSIS

int SPI_connect(void)

int SPI_connect_ext(int options)

πŸ¦‹ DESCRIPTION

SPI_connect opens a connection from a C function invocation to the SPI manager. You must call this function if you want to execute commands through SPI. Some utility SPI functions can be called from unconnected C functions, iykyk πŸ‘‘

SPI_connect_ext does the same thing, but it has an argument that lets you pass option flags. Currently, the following option values are available:

  • SPI_OPT_NONATOMIC β€” sets the SPI connection to be nonatomic, which means transaction control calls (SPI_commit, SPI_rollback) are allowed. Otherwise, calling those functions will result in an immediate error 🚨

SPI_connect() is equivalent to SPI_connect_ext(0) β€” no cap, literally the same vibe πŸ’…


⭐ RETURN VALUE

  • SPI_OK_CONNECT β€” on success ✨
  • SPI_ERROR_CONNECT β€” on error 😭

Source/version: PostgreSQL 16.15 Β· Date: 2026 Β· byeee bestie, go slay those SPI calls πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from