Wiki / 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
Compare versions
PostgreSQL 12 → 13: changed.
--- PostgreSQL 12
+++ PostgreSQL 13
@@ -17,6 +17,6 @@
"value": "NULL (no hook installed)"
}
],
- "signature": "typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, char *completionTag);\nextern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook;",
+ "signature": "typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt, const char *queryString, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc);\nextern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook;",
"tables": null
}
Compares recorded interfaces and attributes. Source fingerprints and build metadata are excluded; an absent sample is not proof of the introduction or removal release.
Related entries
post_parse_analyze_hookpost_parse_analyze_hook
Export JSON · Back to Hooks · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.