Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Request a Demo
SPI_connect
Prev Up45.1. Interface FunctionsHome Next

SPI_connect

SPI_connect, SPI_connect_ext — connect a C function to the SPI manager

Synopsis

int SPI_connect(void)
int SPI_connect_ext(intoptions)

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.

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

SPI_OPT_NONATOMIC

Sets the SPI connection to benonatomic, which means that transaction control calls (SPI_commit,SPI_rollback) are allowed. Otherwise, calling those functions will result in an immediate error.

SPI_connect() is equivalent toSPI_connect_ext(0).

Return Value

SPI_OK_CONNECT

on success

The fact that these functions returnint notvoid is historical. All failure cases are reported viaereport orelog. (In versions beforePostgreSQL v10, some but not all failures would be reported with a result value ofSPI_ERROR_CONNECT.)


Prev Up Next
45.1. Interface Functions Home SPI_finish
epubpdf
Go to PostgreSQL 18
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp