SPI_CONNECT(3)
πΈ NAME β SPI_CONNECT(3) πΈ
SPI_connect, SPI_connect_ext β connect a C function to the SPI manager π
Okay bestie, manual-name moment: this is the PostgreSQL 13.23 Documentation page for SPI_CONNECT(3), folded in right at the top so weβre not copying that boring header line like itβs a PDF from 2009. π«Ά
β¨ 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. A few utility SPI functions can still be called from unconnected C functions β lowkey convenient, no cap.
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. β οΈ That βimmediate errorβ part is real, so donβt sleep on it.
Also, SPI_connect() is equivalent to SPI_connect_ext(0). Same energy, different signature. π«
π RETURN VALUE π
SPI_OK_CONNECTβ on success πSPI_ERROR_CONNECTβ on error π
Made with π for PostgreSQL 13.23, dated 2025, and filed under SPI_CONNECT(3) β bye bestie, go connect responsibly! π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql13-docs 13.23-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