1SPI_CONNECT(3) PostgreSQL 9.2.24 Documentation SPI_CONNECT(3)
2
3
4
6 SPI_connect - connect a procedure to the SPI manager
7
9 int SPI_connect(void)
10
12 SPI_connect opens a connection from a procedure invocation to the SPI
13 manager. You must call this function if you want to execute commands
14 through SPI. Some utility SPI functions can be called from unconnected
15 procedures.
16
17 If your procedure is already connected, SPI_connect will return the
18 error code SPI_ERROR_CONNECT. This could happen if a procedure that has
19 called SPI_connect directly calls another procedure that calls
20 SPI_connect. While recursive calls to the SPI manager are permitted
21 when an SQL command called through SPI invokes another function that
22 uses SPI, directly nested calls to SPI_connect and SPI_finish are
23 forbidden. (But see SPI_push and SPI_pop.)
24
26 SPI_OK_CONNECT
27 on success
28
29 SPI_ERROR_CONNECT
30 on error
31
32
33
34PostgreSQL 9.2.24 2017-11-06 SPI_CONNECT(3)