Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
SPI_CONNECT(3)		  PostgreSQL 18.6 Documentation 	  SPI_CONNECT(3)

NAME
     SPI_connect, SPI_connect_ext - connect a C function to the SPI manager

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 man-
     ager.  You  must call this function if you want to execute commands through
     SPI. Some utility SPI functions can be called from unconnected C functions.

     SPI_connect_ext does the same but has an argument that allows  passing  op-
     tion flags. Currently, the following option values are available:

     SPI_OPT_NONATOMIC
	 Sets  the  SPI connection to be nonatomic, which means that transaction
	 control calls (SPI_commit, SPI_rollback) are allowed. Otherwise,  call-
	 ing those functions will result in an immediate error.

     SPI_connect() is equivalent to SPI_connect_ext(0).

RETURN VALUE
     SPI_OK_CONNECT
	 on success

     The  fact that these functions return int not void is historical. All fail-
     ure cases are reported via ereport or elog. (In versions before  PostgreSQL
     v10,  some  but  not  all failures would be reported with a result value of
     SPI_ERROR_CONNECT.)

PostgreSQL 18.6 		      2026			  SPI_CONNECT(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=SPI_connect_ext&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help