SPI_CONNECT(3)

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

🌸 NAME 🌸

Okay so this is the SPI_CONNECT(3) page, bestie β€” and it's literally about SPI_connect and SPI_connect_ext: they connect a C function to the SPI manager. Periodt.

✨ 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, so it's giving "not every SPI thing needs the full connection." πŸ’…

SPI_connect_ext does the same thing, but it has an argument that lets you pass option flags. Currently, these 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. So yeah, if you want commit/rollback energy, this flag is your main character. πŸ‘‘

Also, SPI_connect() is equivalent to SPI_connect_ext(0). Cute shorthand, no cap.

🌈 RETURN VALUE 🌈

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

This manual page is from the PostgreSQL 15.19 docs, dated 2026 β€” mwah, go connect those C functions and slay, bestie πŸ«ΆπŸ’–

πŸ“¦ where this page comes from