SPI_finish

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

Синтаксис

int SPI_finish(void)

Описание

SPI_finish закрывает текущее соединение с менеджером SPI. Эту функцию необходимо вызывать после завершения операций SPI, которые должны выполняться в текущем вызове функции на C. Однако если вы прерываете транзакцию, выполняя elog(ERROR), о закрытии соединения можно не беспокоиться. В этом случае SPI произведёт очистку автоматически.

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

SPI_OK_FINISH

если отключение выполнено корректно

SPI_ERROR_UNCONNECTED

если вызывается из неподключённой функции на C

34.5. applicable_roles

The view applicable_roles identifies all roles whose privileges the current user can use. This means there is some chain of role grants from the current user to the role in question. The current user itself is also an applicable role. The set of applicable roles is generally used for permission checking.

Table 34-3. applicable_roles Columns

NameData TypeDescription
granteesql_identifier Name of the role to which this role membership was granted (can be the current user, or a different role in case of nested role memberships)
role_namesql_identifierName of a role
is_grantableyes_or_noYES if the grantee has the admin option on the role, NO if not