{"Entry":{"collection":"plan","key":"custom-scan","name":"Custom Scan","aliases":["Custom Scan (%s)","CustomScan","T_CustomScan"],"metadata":{"aliases":["Custom Scan (%s)","CustomScan","T_CustomScan"],"category":"Extensibility","content_hash":"e42bb000e6ab1d49611da52634bee780e2ced0da09b8479c26e1e7fa5ac1ee0a","imported_at":"2026-09-30T00:40:44.1067+08:00","name":"Custom Scan","name_zh":"CustomScan","slug":"custom-scan","summary":"Executes a plan supplied by a custom-scan provider."}},"Definition":{"Collection":"plan","Key":"custom-scan","SourceDatabase":"center","Version":"18","SourceTable":"plan_node","SourceKey":"custom-scan","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"initializer":"ExecInitCustomScan","memory_mechanism":"unclassified","node_tag":"T_CustomScan","parallel_callbacks":["ExecCustomScanEstimate","ExecCustomScanInitializeDSM","ExecCustomScanInitializeWorker","ExecCustomScanReInitializeDSM"],"partial_modes":[],"strategies":[],"text_names":["Custom Scan (%s)"]},"comparison_hash":"c905b2ddadbea858aa4811fa7d15ee0733e3c82e2ac2c9fad827846072b5c975","description":["Executes a plan supplied by a custom-scan provider."],"evidence_kind":"source and documentation","explain_names":["Custom Scan (%s)"],"explain_prefixes":["Parallel","Async"],"facts":[{"label":"Core node tag","value":"T_CustomScan"},{"label":"Structured EXPLAIN Node Type","value":"Custom Scan"},{"label":"Inputs","value":"Provider-defined plan, possibly with children"},{"label":"Output","value":"Provider-defined tuples"},{"label":"Executor initializer","value":"ExecInitCustomScan"},{"label":"Memory mechanism","value":"unclassified"}],"memory":{"description":"This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider.","evidence":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeCustom.c","path":"src/backend/executor/nodeCustom.c","sha256":"8827a109e7111830daadc159c1f37519f8856040c3bd194f8055b379f7c34dff","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"mechanism":"unclassified","source_notes":[]},"node_tag":"T_CustomScan","parallel_callbacks":["ExecCustomScanEstimate","ExecCustomScanInitializeDSM","ExecCustomScanInitializeWorker","ExecCustomScanReInitializeDSM"],"partial_modes":[],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"},{"label":"Using EXPLAIN","url":"/docs/18/using-explain.html"},{"label":"Parallel plans","url":"/docs/18/parallel-plans.html"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"PostgreSQL 18.6 source archive","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_snapshot_utc":"","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},"runtime_verified":false,"sections":[{"paragraphs":["Structured formats use the Node Type above. Text-format spellings can also include operation, strategy, join type, scan direction or aggregation-stage attributes.","Text names recorded by this source: Custom Scan (%s).","Parallel-aware and parallel-safe are different plan properties. A node running inside a parallel worker is not necessarily a parallel-aware node."],"title":"EXPLAIN names and attributes"},{"paragraphs":["This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider."],"title":"Memory and temporary storage"},{"paragraphs":["The source callbacks below can coordinate execution or collect worker instrumentation. Their presence is not a blanket claim that this node supports a shared parallel scan or shared state.","Callbacks in this build: ExecCustomScanEstimate, ExecCustomScanInitializeDSM, ExecCustomScanInitializeWorker, ExecCustomScanReInitializeDSM."],"title":"Parallel execution and instrumentation"},{"paragraphs":["nodeCustom.c Routines to handle execution of custom scan node","Allocate the CustomScanState object. We let the custom scan provider do the palloc, in case it wants to make a larger object that embeds CustomScanState as the first field. It must set the node tag and the methods field correctly at this time. Other standard fields should be set to zero.","Use a custom slot if specified in CustomScanState or use virtual slot otherwise.","Determine the scan tuple type. If the custom scan provider provided a targetlist describing the scan tuples, use that; else use base relation's rowtype.","The callback of custom-scan provider applies the final initialization of the custom-scan-state node according to its logic."],"title":"Executor implementation notes"},{"code":"case T_CustomScan:\n\t\t\tsname = \"Custom Scan\";\n\t\t\tcustom_name = ((CustomScan *) plan)-\u003emethods-\u003eCustomName;\n\t\t\tif (custom_name)\n\t\t\t\tpname = psprintf(\"Custom Scan (%s)\", custom_name);\n\t\t\telse\n\t\t\t\tpname = sname;\n\t\t\tbreak;","title":"EXPLAIN identity in core source"}],"source_inventory":{"executor":"src/backend/executor/execProcnode.c","explain":"src/backend/commands/explain.c","implementation":"src/backend/executor/nodeCustom.c"},"sources":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/commands/explain.c:1508","line":1508,"path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/execProcnode.c:289","line":289,"path":"src/backend/executor/execProcnode.c","sha256":"f8a06a3f539077249b20664b2812433db6d7bd12b2c0ca633525db43d06f112a","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeCustom.c","path":"src/backend/executor/nodeCustom.c","sha256":"8827a109e7111830daadc159c1f37519f8856040c3bd194f8055b379f7c34dff","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/include/nodes/plannodes.h","path":"src/include/nodes/plannodes.h","sha256":"52422b327a8049fbbb20d8b96008a0fc0a6fafa60f7eff3c695d5b2e83830120","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"strategies":[],"tables":[{"columns":[{"key":"label","label":"Text-format label"},{"key":"identity","label":"Structured node identity"}],"key":"explain-labels","rows":[{"identity":"Custom Scan","label":"Custom Scan (%s)"}],"title":"EXPLAIN labels in this source build"}]},"ManualEvidence":{"release":{"channel":"stable","label":"18.6","major":"18","ref":"PostgreSQL 18.6 source archive","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_snapshot_utc":"","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},"sources":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/commands/explain.c:1508","line":1508,"path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/execProcnode.c:289","line":289,"path":"src/backend/executor/execProcnode.c","sha256":"f8a06a3f539077249b20664b2812433db6d7bd12b2c0ca633525db43d06f112a","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeCustom.c","path":"src/backend/executor/nodeCustom.c","sha256":"8827a109e7111830daadc159c1f37519f8856040c3bd194f8055b379f7c34dff","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/include/nodes/plannodes.h","path":"src/include/nodes/plannodes.h","sha256":"52422b327a8049fbbb20d8b96008a0fc0a6fafa60f7eff3c695d5b2e83830120","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}]},"MeasuredEvidence":{"runtime_verified":false}},"Text":{"Collection":"plan","Key":"custom-scan","SourceDatabase":"center","Version":"18","Locale":"en","Title":"Custom Scan","Summary":"Executes a plan supplied by a custom-scan provider.","BodyHTML":"\u003cp\u003eExecutes a plan supplied by a custom-scan provider.\u003c/p\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"cce42d708e2f6c2de99f6c02bdea9705b041acbea2503292bb9d3184b6f2d18b","Payload":{"description":["Executes a plan supplied by a custom-scan provider."],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"},{"label":"Using EXPLAIN","url":"/docs/18/using-explain.html"},{"label":"Parallel plans","url":"/docs/18/parallel-plans.html"}],"sections":[{"paragraphs":["Structured formats use the Node Type above. Text-format spellings can also include operation, strategy, join type, scan direction or aggregation-stage attributes.","Text names recorded by this source: Custom Scan (%s).","Parallel-aware and parallel-safe are different plan properties. A node running inside a parallel worker is not necessarily a parallel-aware node."],"title":"EXPLAIN names and attributes"},{"paragraphs":["This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider."],"title":"Memory and temporary storage"},{"paragraphs":["The source callbacks below can coordinate execution or collect worker instrumentation. Their presence is not a blanket claim that this node supports a shared parallel scan or shared state.","Callbacks in this build: ExecCustomScanEstimate, ExecCustomScanInitializeDSM, ExecCustomScanInitializeWorker, ExecCustomScanReInitializeDSM."],"title":"Parallel execution and instrumentation"},{"paragraphs":["nodeCustom.c Routines to handle execution of custom scan node","Allocate the CustomScanState object. We let the custom scan provider do the palloc, in case it wants to make a larger object that embeds CustomScanState as the first field. It must set the node tag and the methods field correctly at this time. Other standard fields should be set to zero.","Use a custom slot if specified in CustomScanState or use virtual slot otherwise.","Determine the scan tuple type. If the custom scan provider provided a targetlist describing the scan tuples, use that; else use base relation's rowtype.","The callback of custom-scan provider applies the final initialization of the custom-scan-state node according to its logic."],"title":"Executor implementation notes"},{"code":"case T_CustomScan:\n\t\t\tsname = \"Custom Scan\";\n\t\t\tcustom_name = ((CustomScan *) plan)-\u003emethods-\u003eCustomName;\n\t\t\tif (custom_name)\n\t\t\t\tpname = psprintf(\"Custom Scan (%s)\", custom_name);\n\t\t\telse\n\t\t\t\tpname = sname;\n\t\t\tbreak;","title":"EXPLAIN identity in core source"}],"tables":[{"columns":[{"key":"label","label":"Text-format label"},{"key":"identity","label":"Structured node identity"}],"key":"explain-labels","rows":[{"identity":"Custom Scan","label":"Custom Scan (%s)"}],"title":"EXPLAIN labels in this source build"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
