↑↓ select ↵ open ⌫ change scope Open full search

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

Documentation / Extension Hooks / Parsing and utility commands

ProcessUtility_hook

ProcessUtility_hook

Hook for plugins to get control in ProcessUtility()

Reading PostgreSQL 18.

Description

Hook for plugins to get control in ProcessUtility()

Interface type
ProcessUtility_hook_type
Header
src/include/tcop/utility.h
Subsystem
Parsing and utility commands
Initial value
NULL (no hook installed)

C interface

typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc);
extern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook;

Core source comments

We provide a function hook variable that lets loadable plugins get control when ProcessUtility is called. Such a plugin would normally call standard_ProcessUtility().

Call sites

src/backend/tcop/utility.c:519

Core call context: src/backend/tcop/utility.c:513–527

	/*
	 * We provide a function hook variable that lets loadable plugins get
	 * control when ProcessUtility is called.  Such a plugin would normally
	 * call standard_ProcessUtility().
	 */
	if (ProcessUtility_hook)
		(*ProcessUtility_hook) (pstmt, queryString, readOnlyTree,
								context, params, queryEnv,
								dest, qc);
	else
		standard_ProcessUtility(pstmt, queryString, readOnlyTree,
								context, params, queryEnv,
								dest, qc);
}

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.