1SPI_CONNECT(3) PostgreSQL 11.6 Documentation SPI_CONNECT(3)
2
3
4
6 SPI_connect, SPI_connect_ext - connect a C function to the SPI manager
7
9 int SPI_connect(void)
10
11 int SPI_connect_ext(int options)
12
14 SPI_connect opens a connection from a C function invocation to the SPI
15 manager. You must call this function if you want to execute commands
16 through SPI. Some utility SPI functions can be called from unconnected
17 C functions.
18
19 SPI_connect_ext does the same but has an argument that allows passing
20 option flags. Currently, the following option values are available:
21
22 SPI_OPT_NONATOMIC
23 Sets the SPI connection to be nonatomic, which means that
24 transaction control calls SPI_commit, SPI_rollback, and
25 SPI_start_transaction are allowed. Otherwise, calling these
26 functions will result in an immediate error.
27
28 SPI_connect() is equivalent to SPI_connect_ext(0).
29
31 SPI_OK_CONNECT
32 on success
33
34 SPI_ERROR_CONNECT
35 on error
36
37
38
39PostgreSQL 11.6 2019 SPI_CONNECT(3)