SPI_connect

SPI_connect, SPI_connect_ext — подключить функцию на C к менеджеру SPI

Синтаксис

int SPI_connect(void)
int SPI_connect_ext(int options)

Описание

SPI_connect устанавливает подключение вызова функции на C к менеджеру SPI. Данную функцию необходимо использовать, если вы хотите выполнять команды через SPI. Некоторые вспомогательные функции SPI могут вызываться из неподключённых функций.

SPI_connect_ext делает то же самое, но принимает один аргумент, через который можно передать дополнительные флаги. В настоящее время поддерживаются следующие флаги:

SPI_OPT_NONATOMIC

Переводит подключение SPI в неатомарный режим, в котором разрешаются вызовы функций управления транзакциями (SPI_commit, SPI_rollback). В обычном режиме вызов этих функций приводит к немедленной ошибке.

Вызов SPI_connect() равнозначен SPI_connect_ext(0).

Возвращаемое значение

SPI_OK_CONNECT

при успехе

SPI_ERROR_CONNECT

при ошибке

53.28. pg_init_privs #

The catalog pg_init_privs records information about the initial privileges of objects in the system. There is one entry for each object in the database which has a non-default (non-NULL) initial set of privileges.

Objects can have initial privileges either by having those privileges set when the system is initialized (by initdb) or when the object is created during a CREATE EXTENSION and the extension script sets initial privileges using the GRANT system. Note that the system will automatically handle recording of the privileges during the extension script and that extension authors need only use the GRANT and REVOKE statements in their script to have the privileges recorded. The privtype column indicates if the initial privilege was set by initdb or during a CREATE EXTENSION command.

Objects which have initial privileges set by initdb will have entries where privtype is 'i', while objects which have initial privileges set by CREATE EXTENSION will have entries where privtype is 'e'.

Table 53.28. pg_init_privs Columns

Column Type

Description

objoid oid (references any OID column)

The OID of the specific object

classoid oid (references pg_class.oid)

The OID of the system catalog the object is in

objsubid int4

For a table column, this is the column number (the objoid and classoid refer to the table itself). For all other object types, this column is zero.

privtype char

A code defining the type of initial privilege of this object; see text

initprivs aclitem[]

The initial access privileges; see Section 5.7 for details