{"Entry":{"collection":"hook","key":"executorrun_hook","name":"ExecutorRun_hook","aliases":[],"metadata":{"aliases":[],"category":"Query execution","content_hash":"b4cc0ee8f080247f2e84e0cc626f9384644b2bdaa51051408165ddf5d5a713c2","derived_content_hash":"7943153b60530f99efadcb6222ced933bbe8c96252928b9d9cfc939d512071a2","imported_at":"2026-09-27T17:57:58.864283+08:00","name":"ExecutorRun_hook","name_zh":"ExecutorRun_hook","repair_provenance":{"original_source_revision":"","receipt_sha256":"59b659ab2355665034f672fb1f3e3d75e0ef2365621a5c98171be58d2e5afae1","repair":"wiki-repair-20261023"},"slug":"executorrun_hook","source_rev":"wiki-repair-20261023:41d5577797a46b11b2c50c4c8a750168b2717d6c5bd79ad927a3ee9bcffb2689","summary":"Hook for plugins to get control in ExecutorRun()"}},"Definition":{"Collection":"hook","Key":"executorrun_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"executorrun_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook for plugins to get control in ExecutorRun()"],"description_zh":"供插件在 ExecutorRun() 中接管处理的钩子。","description_zh_html":"\u003cp\u003e供插件在 ExecutorRun() 中接管处理的钩子。\u003c/p\u003e\u003cp\u003e以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。\u003c/p\u003e\u003ch3\u003e接口声明\u003c/h3\u003e\u003cpre\u003etypedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc, ScanDirection direction, uint64 count);\nextern PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook;\u003c/pre\u003e\u003ch3\u003e调用位置\u003c/h3\u003e\u003cul\u003e\u003cli\u003e\u003ccode\u003esrc/backend/executor/execMain.c:301\u003c/code\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e核心调用上下文：src/backend/executor/execMain.c:295–309\u003c/h3\u003e\u003cpre\u003e */\nvoid\nExecutorRun(QueryDesc *queryDesc,\n\t\t\tScanDirection direction, uint64 count)\n{\n\tif (ExecutorRun_hook)\n\t\t(*ExecutorRun_hook) (queryDesc, direction, count);\n\telse\n\t\tstandard_ExecutorRun(queryDesc, direction, count);\n}\n\nvoid\nstandard_ExecutorRun(QueryDesc *queryDesc,\n\t\t\t\t\t ScanDirection direction, uint64 count)\n{\u003c/pre\u003e","facts":[{"label":"Interface type","value":"ExecutorRun_hook_type"},{"label":"Header","value":"src/include/executor/executor.h"},{"label":"Subsystem","value":"Query execution"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[{"label":"The Executor","url":"/docs/18/executor.html"}],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["src/backend/executor/execMain.c:301"],"title":"Call sites"},{"code":" */\nvoid\nExecutorRun(QueryDesc *queryDesc,\n\t\t\tScanDirection direction, uint64 count)\n{\n\tif (ExecutorRun_hook)\n\t\t(*ExecutorRun_hook) (queryDesc, direction, count);\n\telse\n\t\tstandard_ExecutorRun(queryDesc, direction, count);\n}\n\nvoid\nstandard_ExecutorRun(QueryDesc *queryDesc,\n\t\t\t\t\t ScanDirection direction, uint64 count)\n{","paragraphs":[],"title":"Core call context: src/backend/executor/execMain.c:295–309"}],"signature":"typedef void (*ExecutorRun_hook_type) (QueryDesc *queryDesc, ScanDirection direction, uint64 count);\nextern PGDLLIMPORT ExecutorRun_hook_type ExecutorRun_hook;","sources":[{"label":"Interface declaration","path":"src/include/executor/executor.h","sha256":"65710b17bb91a8fe6367654bb27b67ef7a7c238f79ba46248f92a3b8302cd4bb","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/executor/executor.h#L79"},{"label":"Core definition","path":"src/backend/executor/execMain.c","sha256":"a0407447270840acd8a9902c444693d97c765fd8e056dbadc66d36a3327fb0ef","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/executor/execMain.c#L69"},{"label":"Call sites","path":"src/backend/executor/execMain.c","sha256":"a0407447270840acd8a9902c444693d97c765fd8e056dbadc66d36a3327fb0ef","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/executor/execMain.c#L301"}],"translation_provenance":{"inputs":[{"label":"Interface declaration","path":"src/include/executor/executor.h","sha256":"65710b17bb91a8fe6367654bb27b67ef7a7c238f79ba46248f92a3b8302cd4bb","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/executor/executor.h#L79"},{"label":"Core definition","path":"src/backend/executor/execMain.c","sha256":"a0407447270840acd8a9902c444693d97c765fd8e056dbadc66d36a3327fb0ef","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/executor/execMain.c#L69"},{"label":"Call sites","path":"src/backend/executor/execMain.c","sha256":"a0407447270840acd8a9902c444693d97c765fd8e056dbadc66d36a3327fb0ef","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/executor/execMain.c#L301"}],"kind":"authored-source-translation","locale":"zh-Hans","source_revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","translated_source_sha256":"7bfd94dd0fd7ea5a5fac8ca39f393de38bf846b328b9c01c5c07a8ec06d7963a","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/executor/executor.h","sha256":"65710b17bb91a8fe6367654bb27b67ef7a7c238f79ba46248f92a3b8302cd4bb","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/executor/executor.h#L79"},{"label":"Core definition","path":"src/backend/executor/execMain.c","sha256":"a0407447270840acd8a9902c444693d97c765fd8e056dbadc66d36a3327fb0ef","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/executor/execMain.c#L69"},{"label":"Call sites","path":"src/backend/executor/execMain.c","sha256":"a0407447270840acd8a9902c444693d97c765fd8e056dbadc66d36a3327fb0ef","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/executor/execMain.c#L301"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"executorrun_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"ExecutorRun_hook","Summary":"Hook for plugins to get control in ExecutorRun()","BodyHTML":"\u003cp\u003eHook for plugins to get control in ExecutorRun()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"6286c7e3f3e627d624ea4c85c316bb2256ef8cf197149abdd3efa7340a2af4ce","Payload":{"description":["Hook for plugins to get control in ExecutorRun()"],"related":[{"label":"The Executor","url":"/docs/18/executor.html"}],"sections":[{"paragraphs":["src/backend/executor/execMain.c:301"],"title":"Call sites"},{"code":" */\nvoid\nExecutorRun(QueryDesc *queryDesc,\n\t\t\tScanDirection direction, uint64 count)\n{\n\tif (ExecutorRun_hook)\n\t\t(*ExecutorRun_hook) (queryDesc, direction, count);\n\telse\n\t\tstandard_ExecutorRun(queryDesc, direction, count);\n}\n\nvoid\nstandard_ExecutorRun(QueryDesc *queryDesc,\n\t\t\t\t\t ScanDirection direction, uint64 count)\n{","paragraphs":[],"title":"Core call context: src/backend/executor/execMain.c:295–309"}]}},"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}
