↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Documentation / Extension Hooks / Permissions and object access

row_security_policy_hook_restrictive

row_security_policy_hook_restrictive

row_security_policy_hook_restrictive: core extension hook declared in src/include/rewrite/rowsecurity.h. The exact interface and call sites are recorded below.

Reading PostgreSQL 18.

Description

row_security_policy_hook_restrictive: core extension hook declared in src/include/rewrite/rowsecurity.h. The exact interface and call sites are recorded below.

Interface type
row_security_policy_hook_type
Header
src/include/rewrite/rowsecurity.h
Subsystem
Permissions and object access
Initial value
NULL (no hook installed)

C interface

typedef List *(*row_security_policy_hook_type) (CmdType cmdtype, Relation relation);
extern PGDLLIMPORT row_security_policy_hook_type row_security_policy_hook_restrictive;

Call sites

src/backend/rewrite/rowsecurity.c:622

Core call context: src/backend/rewrite/rowsecurity.c:616–630

	 * These are simply appended to the lists of internal policies, if they
	 * apply to the specified role.
	 */
	if (row_security_policy_hook_restrictive)
	{
		List	   *hook_policies =
			(*row_security_policy_hook_restrictive) (cmd, relation);

		/*
		 * As with built-in restrictive policies, we sort any hook-provided
		 * restrictive policies by name also.  Note that we also intentionally
		 * always check all built-in restrictive policies, in name order,
		 * before checking restrictive policies added by hooks, in name order.
		 */
		sort_policies_by_name(hook_policies);

Related entries

Documentation and source

Source build
Version
18
Build
REL_18_STABLE
Source fingerprint
753057e340da8f22e57c9a409ea7a235fd6a46bd

Related entries

Back to Extension Hooks · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.