{"Entry":{"collection":"plan","key":"foreign-scan","name":"Foreign Scan","aliases":["Foreign Delete","Foreign Insert","Foreign Scan","Foreign Update","ForeignScan","T_ForeignScan"],"metadata":{"aliases":["Foreign Delete","Foreign Insert","Foreign Scan","Foreign Update","ForeignScan","T_ForeignScan"],"category":"Extensibility","content_hash":"e8a00b1256b63b1dbb9ad615be10919cbcedb8e05e607c6892c146112d2d2ab7","imported_at":"2026-09-30T00:40:44.111867+08:00","name":"Foreign Scan","name_zh":"ForeignScan","slug":"foreign-scan","summary":"Delegates a foreign scan or supported direct modification to the foreign-data wrapper."}},"Definition":{"Collection":"plan","Key":"foreign-scan","SourceDatabase":"center","Version":"18","SourceTable":"plan_node","SourceKey":"foreign-scan","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"initializer":"ExecInitForeignScan","memory_mechanism":"unclassified","node_tag":"T_ForeignScan","parallel_callbacks":["ExecForeignScanEstimate","ExecForeignScanInitializeDSM","ExecForeignScanInitializeWorker","ExecForeignScanReInitializeDSM"],"partial_modes":[],"strategies":[],"text_names":["Foreign Scan","Foreign Insert","Foreign Update","Foreign Delete"]},"comparison_hash":"1c2fce5096a585774ac71065ed48f534475dbb94feb6a37eb58f5b2ea8f25ac5","description":["Delegates a foreign scan or supported direct modification to the foreign-data wrapper."],"evidence_kind":"source and documentation","explain_names":["Foreign Scan","Foreign Insert","Foreign Update","Foreign Delete"],"explain_prefixes":["Parallel","Async"],"facts":[{"label":"Core node tag","value":"T_ForeignScan"},{"label":"Structured EXPLAIN Node Type","value":"Foreign Scan"},{"label":"Inputs","value":"Foreign-data wrapper plan and callbacks"},{"label":"Output","value":"Provider-defined scan or RETURNING tuples"},{"label":"Executor initializer","value":"ExecInitForeignScan"},{"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/nodeForeignscan.c","path":"src/backend/executor/nodeForeignscan.c","sha256":"37b85b68b6fc26d94e40d9173dbfed8b69c70877c54ee72ffc761e2f7b876a0c","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"mechanism":"unclassified","source_notes":[]},"node_tag":"T_ForeignScan","parallel_callbacks":["ExecForeignScanEstimate","ExecForeignScanInitializeDSM","ExecForeignScanInitializeWorker","ExecForeignScanReInitializeDSM"],"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: Foreign Scan, Foreign Insert, Foreign Update, Foreign Delete.","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: ExecForeignScanEstimate, ExecForeignScanInitializeDSM, ExecForeignScanInitializeWorker, ExecForeignScanReInitializeDSM."],"title":"Parallel execution and instrumentation"},{"paragraphs":["nodeForeignscan.c Routines to support scans of foreign tables","ExecForeignScan scans a foreign table. ExecInitForeignScan creates and initializes state info. ExecReScanForeignScan rescans the foreign relation. ExecEndForeignScan releases any resources allocated.","direct modifications cannot be re-evaluated, so shouldn't get here during EvalPlanQual processing","Insert valid value into tableoid, the only actually-useful system column.","ForeignRecheck -- access method routine to recheck a tuple in EvalPlanQual"],"title":"Executor implementation notes"},{"code":"case T_ForeignScan:\n\t\t\tsname = \"Foreign Scan\";\n\t\t\tswitch (((ForeignScan *) plan)-\u003eoperation)\n\t\t\t{\n\t\t\t\tcase CMD_SELECT:\n\t\t\t\t\tpname = \"Foreign Scan\";\n\t\t\t\t\toperation = \"Select\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase CMD_INSERT:\n\t\t\t\t\tpname = \"Foreign Insert\";\n\t\t\t\t\toperation = \"Insert\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase CMD_UPDATE:\n\t\t\t\t\tpname = \"Foreign Update\";\n\t\t\t\t\toperation = \"Update\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase CMD_DELETE:\n\t\t\t\t\tpname = \"Foreign Delete\";\n\t\t\t\t\toperation = \"Delete\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpname = \"???\";\n\t\t\t\t\tbreak;\n\t\t\t}\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/nodeForeignscan.c"},"sources":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/commands/explain.c:1483","line":1483,"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:284","line":284,"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/nodeForeignscan.c","path":"src/backend/executor/nodeForeignscan.c","sha256":"37b85b68b6fc26d94e40d9173dbfed8b69c70877c54ee72ffc761e2f7b876a0c","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":"Foreign Scan","label":"Foreign Scan"},{"identity":"Foreign Scan","label":"Foreign Insert"},{"identity":"Foreign Scan","label":"Foreign Update"},{"identity":"Foreign Scan","label":"Foreign Delete"}],"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:1483","line":1483,"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:284","line":284,"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/nodeForeignscan.c","path":"src/backend/executor/nodeForeignscan.c","sha256":"37b85b68b6fc26d94e40d9173dbfed8b69c70877c54ee72ffc761e2f7b876a0c","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":"foreign-scan","SourceDatabase":"center","Version":"18","Locale":"en","Title":"Foreign Scan","Summary":"Delegates a foreign scan or supported direct modification to the foreign-data wrapper.","BodyHTML":"\u003cp\u003eDelegates a foreign scan or supported direct modification to the foreign-data wrapper.\u003c/p\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"ffcc186fa8c11b89acdd311507f417a6ed018b969049d6f7e9d2b45713930006","Payload":{"description":["Delegates a foreign scan or supported direct modification to the foreign-data wrapper."],"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: Foreign Scan, Foreign Insert, Foreign Update, Foreign Delete.","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: ExecForeignScanEstimate, ExecForeignScanInitializeDSM, ExecForeignScanInitializeWorker, ExecForeignScanReInitializeDSM."],"title":"Parallel execution and instrumentation"},{"paragraphs":["nodeForeignscan.c Routines to support scans of foreign tables","ExecForeignScan scans a foreign table. ExecInitForeignScan creates and initializes state info. ExecReScanForeignScan rescans the foreign relation. ExecEndForeignScan releases any resources allocated.","direct modifications cannot be re-evaluated, so shouldn't get here during EvalPlanQual processing","Insert valid value into tableoid, the only actually-useful system column.","ForeignRecheck -- access method routine to recheck a tuple in EvalPlanQual"],"title":"Executor implementation notes"},{"code":"case T_ForeignScan:\n\t\t\tsname = \"Foreign Scan\";\n\t\t\tswitch (((ForeignScan *) plan)-\u003eoperation)\n\t\t\t{\n\t\t\t\tcase CMD_SELECT:\n\t\t\t\t\tpname = \"Foreign Scan\";\n\t\t\t\t\toperation = \"Select\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase CMD_INSERT:\n\t\t\t\t\tpname = \"Foreign Insert\";\n\t\t\t\t\toperation = \"Insert\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase CMD_UPDATE:\n\t\t\t\t\tpname = \"Foreign Update\";\n\t\t\t\t\toperation = \"Update\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase CMD_DELETE:\n\t\t\t\t\tpname = \"Foreign Delete\";\n\t\t\t\t\toperation = \"Delete\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpname = \"???\";\n\t\t\t\t\tbreak;\n\t\t\t}\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":"Foreign Scan","label":"Foreign Scan"},{"identity":"Foreign Scan","label":"Foreign Insert"},{"identity":"Foreign Scan","label":"Foreign Update"},{"identity":"Foreign Scan","label":"Foreign Delete"}],"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}
