{"Entry":{"collection":"hook","key":"processutility_hook","name":"ProcessUtility_hook","aliases":[],"metadata":{"aliases":[],"category":"Parsing and utility commands","content_hash":"fad7b2deaaf5285ba21b2da5819afd853f016c08943a874fe9c86f0b88cc9d80","derived_content_hash":"156e611a22b8351ce27073c5a7957bb75522fbb0836c2653986b55d285136e14","imported_at":"2026-09-27T17:57:58.84927+08:00","name":"ProcessUtility_hook","name_zh":"ProcessUtility_hook","repair_provenance":{"original_source_revision":"","receipt_sha256":"2c6e5a2a69434ae097deb1b36ad3f2279d5d2129805658f16e5d87798a3b8a61","repair":"wiki-repair-20261023"},"slug":"processutility_hook","source_rev":"wiki-repair-20261023:dbb129e1f714a6dc453bb7d89dc0350577fe4e9395aa8b3a198973bb9b3c2602","summary":"Hook for plugins to get control in ProcessUtility()"}},"Definition":{"Collection":"hook","Key":"processutility_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"processutility_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for plugins to get control in ProcessUtility()"],"description_zh":"供插件在 ProcessUtility() 中接管处理的钩子。","description_zh_html":"\u003cp\u003e供插件在 ProcessUtility() 中接管处理的钩子。\u003c/p\u003e\u003cp\u003e以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。\u003c/p\u003e\u003ch3\u003e接口声明\u003c/h3\u003e\u003cpre\u003etypedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc);\nextern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook;\u003c/pre\u003e\u003ch3\u003e源码说明\u003c/h3\u003e\u003cp\u003e此函数钩子变量允许可加载插件在 ProcessUtility 被调用时接管处理。插件通常应调用 standard_ProcessUtility()。\u003c/p\u003e\u003ch3\u003e调用位置\u003c/h3\u003e\u003cul\u003e\u003cli\u003e\u003ccode\u003esrc/backend/tcop/utility.c:519\u003c/code\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e核心调用上下文：src/backend/tcop/utility.c:513–527\u003c/h3\u003e\u003cpre\u003e\t/*\n\t * We provide a function hook variable that lets loadable plugins get\n\t * control when ProcessUtility is called.  Such a plugin would normally\n\t * call standard_ProcessUtility().\n\t */\n\tif (ProcessUtility_hook)\n\t\t(*ProcessUtility_hook) (pstmt, queryString, readOnlyTree,\n\t\t\t\t\t\t\t\tcontext, params, queryEnv,\n\t\t\t\t\t\t\t\tdest, qc);\n\telse\n\t\tstandard_ProcessUtility(pstmt, queryString, readOnlyTree,\n\t\t\t\t\t\t\t\tcontext, params, queryEnv,\n\t\t\t\t\t\t\t\tdest, qc);\n}\n\u003c/pre\u003e","facts":[{"label":"Interface type","value":"ProcessUtility_hook_type"},{"label":"Header","value":"src/include/tcop/utility.h"},{"label":"Subsystem","value":"Parsing and utility commands"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["We provide a function hook variable that lets loadable plugins get control when ProcessUtility is called. Such a plugin would normally call standard_ProcessUtility()."],"title":"Core source comments"},{"paragraphs":["src/backend/tcop/utility.c:519"],"title":"Call sites"},{"code":"\t/*\n\t * We provide a function hook variable that lets loadable plugins get\n\t * control when ProcessUtility is called.  Such a plugin would normally\n\t * call standard_ProcessUtility().\n\t */\n\tif (ProcessUtility_hook)\n\t\t(*ProcessUtility_hook) (pstmt, queryString, readOnlyTree,\n\t\t\t\t\t\t\t\tcontext, params, queryEnv,\n\t\t\t\t\t\t\t\tdest, qc);\n\telse\n\t\tstandard_ProcessUtility(pstmt, queryString, readOnlyTree,\n\t\t\t\t\t\t\t\tcontext, params, queryEnv,\n\t\t\t\t\t\t\t\tdest, qc);\n}\n","paragraphs":[],"title":"Core call context: src/backend/tcop/utility.c:513–527"}],"signature":"typedef void (*ProcessUtility_hook_type) (PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc);\nextern PGDLLIMPORT ProcessUtility_hook_type ProcessUtility_hook;","sources":[{"label":"Interface declaration","path":"src/include/tcop/utility.h","sha256":"726bfca02c8e0186b1b57f19c3319d11756d6b70a1b6f1cba7750c07aabdbbc3","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/tcop/utility.h#L71"},{"label":"Core definition","path":"src/backend/tcop/utility.c","sha256":"7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/tcop/utility.c#L70"},{"label":"Call sites","path":"src/backend/tcop/utility.c","sha256":"7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/tcop/utility.c#L519"}],"translation_provenance":{"inputs":[{"label":"Interface declaration","path":"src/include/tcop/utility.h","sha256":"726bfca02c8e0186b1b57f19c3319d11756d6b70a1b6f1cba7750c07aabdbbc3","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/tcop/utility.h#L71"},{"label":"Core definition","path":"src/backend/tcop/utility.c","sha256":"7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/tcop/utility.c#L70"},{"label":"Call sites","path":"src/backend/tcop/utility.c","sha256":"7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/tcop/utility.c#L519"}],"kind":"authored-source-translation","locale":"zh-Hans","source_revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","translated_source_sha256":"6da626d02c16b61042d6dbd35d454aaa16eedce2eada327c227045e8a232b5ce","version":"18"},"zh_from":"authored-source-translation"},"ManualEvidence":{"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sources":[{"label":"Interface declaration","path":"src/include/tcop/utility.h","sha256":"726bfca02c8e0186b1b57f19c3319d11756d6b70a1b6f1cba7750c07aabdbbc3","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/tcop/utility.h#L71"},{"label":"Core definition","path":"src/backend/tcop/utility.c","sha256":"7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/tcop/utility.c#L70"},{"label":"Call sites","path":"src/backend/tcop/utility.c","sha256":"7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/tcop/utility.c#L519"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"processutility_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"ProcessUtility_hook","Summary":"Hook for plugins to get control in ProcessUtility()","BodyHTML":"\u003cp\u003eHook for plugins to get control in ProcessUtility()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"cf98ee1e0fe14d62d7e96fa5fd5639445a0cc51ca07332c8ad4da5e753cbd528","Payload":{"description":["Hook for plugins to get control in ProcessUtility()"],"related":[],"sections":[{"paragraphs":["We provide a function hook variable that lets loadable plugins get control when ProcessUtility is called. Such a plugin would normally call standard_ProcessUtility()."],"title":"Core source comments"},{"paragraphs":["src/backend/tcop/utility.c:519"],"title":"Call sites"},{"code":"\t/*\n\t * We provide a function hook variable that lets loadable plugins get\n\t * control when ProcessUtility is called.  Such a plugin would normally\n\t * call standard_ProcessUtility().\n\t */\n\tif (ProcessUtility_hook)\n\t\t(*ProcessUtility_hook) (pstmt, queryString, readOnlyTree,\n\t\t\t\t\t\t\t\tcontext, params, queryEnv,\n\t\t\t\t\t\t\t\tdest, qc);\n\telse\n\t\tstandard_ProcessUtility(pstmt, queryString, readOnlyTree,\n\t\t\t\t\t\t\t\tcontext, params, queryEnv,\n\t\t\t\t\t\t\t\tdest, qc);\n}\n","paragraphs":[],"title":"Core call context: src/backend/tcop/utility.c:513–527"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
