{"kind": "fdw", "major": "18", "item": {"slug": "file_fdw", "name": "file_fdw", "name_zh": "Server files", "category": "\u670d\u52a1\u5668\u6587\u4ef6", "summary": "\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002", "aliases": [], "content_hash": "611c25a212d8094b0e4a11c88be7191c66554c28aa326731671ef37bd10349ce", "versions": {"10": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=10", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=10", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 10.23 source archive", "label": "10.23", "major": "10", "channel": "historical", "revision": "94a4b2528372458e5662c18d406629266667c437198160a18cdfd2c4a4d6eee9", "source_url": "https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/10/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 10 English manual", "sha256": "2c49f46e371f19bba82d29145505e94032593c7bb4dabf095ca55256ebd7808b", "language": "en", "original_url": "/docs/10/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.bz2", "line": 170, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:170", "sha256": "a24eff98f652c7f49aa53495a0be689db2dd8f24749fb4cf955a8d6aeb845c70", "archive_sha256": "94a4b2528372458e5662c18d406629266667c437198160a18cdfd2c4a4d6eee9"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">F.15.\u00a0file_fdw</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/10/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 OIDS \u548c FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\uff1a\u53ea\u6709\u8d85\u7ea7\u7528\u6237\u624d\u80fd\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u53ef\u4ee5\u5141\u8bb8\u975e\u8d85\u7ea7\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.24.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/10/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text\n) SERVER pglog\nOPTIONS ( filename '/home/josh/data/log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div>\n<br class=\"example-break\"/></div>", "manual_path": "/docs/10/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/10/datatype-binary.html", "method": "same-major semantic node", "sha256": "f981bb7bc95d8409ea122ef799257c5c71683556c7a24ed59d269124c290e9db", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/10/file-fdw.html", "method": "same-major semantic node", "sha256": "9b530983bef144c36850c2aaabdc0debd469feacb6552f40653414bd25285d0f", "language": "zh", "matched_nodes": ["#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/10/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/10/facts/0/label": "Interface family", "/versions/10/facts/0/value": "Foreign-data wrapper", "/versions/10/facts/1/label": "Handler or routine", "/versions/10/facts/2/label": "Recorded callbacks", "/versions/10/tables/0/title": "Registered interface handlers", "/versions/10/tables/1/title": "Documented options", "/versions/10/related/0/label": "Foreign-data wrapper catalog", "/versions/10/related/1/label": "Existing extension catalogue identity", "/versions/10/related/2/label": "Foreign Scan plan node", "/versions/10/sections/0/title": "Interface and capability boundaries", "/versions/10/sections/1/title": "File access boundary", "/versions/10/sections/2/title": "Registered implementation in core source", "/versions/10/tables/1/rows/6/name": "escape", "/versions/10/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/10/tables/0/rows/1/state": "No handler registered in this build", "/versions/10/tables/0/rows/2/state": "No handler registered in this build", "/versions/10/tables/0/rows/3/state": "No handler registered in this build", "/versions/10/tables/0/rows/4/state": "No handler registered in this build", "/versions/10/tables/0/rows/5/state": "No handler registered in this build", "/versions/10/tables/0/rows/6/state": "No handler registered in this build", "/versions/10/tables/0/rows/7/state": "No handler registered in this build", "/versions/10/tables/0/rows/8/state": "No handler registered in this build", "/versions/10/tables/0/rows/9/state": "No handler registered in this build", "/versions/10/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/10/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/10/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/10/tables/0/rows/0/feature": "Scan rows", "/versions/10/tables/0/rows/5/feature": "Join path pushdown", "/versions/10/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/10/tables/0/rows/7/feature": "Batch insert", "/versions/10/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/10/tables/0/rows/9/feature": "Import schema", "/versions/10/tables/0/columns/0/label": "Interface operation", "/versions/10/tables/0/columns/1/label": "Source observation", "/versions/10/tables/0/columns/2/label": "Callback", "/versions/10/tables/0/columns/3/label": "Implementation", "/versions/10/tables/1/columns/0/label": "Option", "/versions/10/tables/1/columns/1/label": "Same-version definition", "/versions/10/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/10/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/10/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/10/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/10/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/10/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/10/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/10/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/10/tables/1/rows/8/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/10/tables/1/rows/9/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/10/tables/1/rows/10/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/10/tables/0/rows/1/implementation": "Not registered", "/versions/10/tables/0/rows/2/implementation": "Not registered", "/versions/10/tables/0/rows/3/implementation": "Not registered", "/versions/10/tables/0/rows/4/implementation": "Not registered", "/versions/10/tables/0/rows/5/implementation": "Not registered", "/versions/10/tables/0/rows/6/implementation": "Not registered", "/versions/10/tables/0/rows/7/implementation": "Not registered", "/versions/10/tables/0/rows/8/implementation": "Not registered", "/versions/10/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "9b8d61870c3fc7a0caff66db6356d08cea768ed82b8b8371f09c71e6f9318fe5"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "e3667962550d31793ff1cfb28056ac711b0cfd15ff9da272242f5b472d17c327", "manual_language": "zh", "runtime_verified": false}, "11": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=11", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=11", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 11.22 source archive", "label": "11.22", "major": "11", "channel": "historical", "revision": "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0", "source_url": "https://ftp.postgresql.org/pub/source/v11.22/postgresql-11.22.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/11/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 11 English manual", "sha256": "a093c1a343e390c649afdec716275796f917757c684cffc97832e71cadf4f97b", "language": "en", "original_url": "/docs/11/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v11.22/postgresql-11.22.tar.bz2", "line": 171, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:171", "sha256": "c2612324f035b7416674c9c8762baea085033b8257c3a1963d7cf34f4f15ecf8", "archive_sha256": "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">F.14.\u00a0file_fdw</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/11/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 OIDS \u548c FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u9ed8\u8ba4\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u9ed8\u8ba4\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.23.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/11/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text\n) SERVER pglog\nOPTIONS ( filename '/home/josh/data/log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/11/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/11/datatype-binary.html", "method": "same-major semantic node", "sha256": "3ead1d2ccb72e70265d17ab2ffd6825ab2d5d8e9360ecc7467dceacd03bcedd6", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/11/file-fdw.html", "method": "same-major semantic node", "sha256": "03bf9491e357eafe27b49f07727b68aa993c885405da3840fd3c4fea301aee83", "language": "zh", "matched_nodes": ["#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/11/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/11/facts/0/label": "Interface family", "/versions/11/facts/0/value": "Foreign-data wrapper", "/versions/11/facts/1/label": "Handler or routine", "/versions/11/facts/2/label": "Recorded callbacks", "/versions/11/tables/0/title": "Registered interface handlers", "/versions/11/tables/1/title": "Documented options", "/versions/11/related/0/label": "Foreign-data wrapper catalog", "/versions/11/related/1/label": "Existing extension catalogue identity", "/versions/11/related/2/label": "Foreign Scan plan node", "/versions/11/sections/0/title": "Interface and capability boundaries", "/versions/11/sections/1/title": "File access boundary", "/versions/11/sections/2/title": "Registered implementation in core source", "/versions/11/tables/1/rows/6/name": "escape", "/versions/11/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/11/tables/0/rows/1/state": "No handler registered in this build", "/versions/11/tables/0/rows/2/state": "No handler registered in this build", "/versions/11/tables/0/rows/3/state": "No handler registered in this build", "/versions/11/tables/0/rows/4/state": "No handler registered in this build", "/versions/11/tables/0/rows/5/state": "No handler registered in this build", "/versions/11/tables/0/rows/6/state": "No handler registered in this build", "/versions/11/tables/0/rows/7/state": "No handler registered in this build", "/versions/11/tables/0/rows/8/state": "No handler registered in this build", "/versions/11/tables/0/rows/9/state": "No handler registered in this build", "/versions/11/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/11/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/11/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/11/tables/0/rows/0/feature": "Scan rows", "/versions/11/tables/0/rows/5/feature": "Join path pushdown", "/versions/11/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/11/tables/0/rows/7/feature": "Batch insert", "/versions/11/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/11/tables/0/rows/9/feature": "Import schema", "/versions/11/tables/0/columns/0/label": "Interface operation", "/versions/11/tables/0/columns/1/label": "Source observation", "/versions/11/tables/0/columns/2/label": "Callback", "/versions/11/tables/0/columns/3/label": "Implementation", "/versions/11/tables/1/columns/0/label": "Option", "/versions/11/tables/1/columns/1/label": "Same-version definition", "/versions/11/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/11/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/11/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/11/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/11/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/11/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/11/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/11/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/11/tables/1/rows/8/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/11/tables/1/rows/9/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/11/tables/1/rows/10/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/11/tables/0/rows/1/implementation": "Not registered", "/versions/11/tables/0/rows/2/implementation": "Not registered", "/versions/11/tables/0/rows/3/implementation": "Not registered", "/versions/11/tables/0/rows/4/implementation": "Not registered", "/versions/11/tables/0/rows/5/implementation": "Not registered", "/versions/11/tables/0/rows/6/implementation": "Not registered", "/versions/11/tables/0/rows/7/implementation": "Not registered", "/versions/11/tables/0/rows/8/implementation": "Not registered", "/versions/11/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "ff864fd6629fb7ff10733b2870ac9e5c99272f9214f42d2e64fbf9e7b9bffa2d"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "e3667962550d31793ff1cfb28056ac711b0cfd15ff9da272242f5b472d17c327", "manual_language": "zh", "runtime_verified": false}, "12": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=12", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=12", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 12.22 source archive", "label": "12.22", "major": "12", "channel": "historical", "revision": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b", "source_url": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/12/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 12 English manual", "sha256": "56a0b61b2cbf0d1aca9240a2fdc451d1f52e808bc77228a908c62c2ed6bfd6f8", "language": "en", "original_url": "/docs/12/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "line": 171, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:171", "sha256": "7653549d5399d68e26b5a622e91b809be4018ce732dee898f00aa07eee5a2271", "archive_sha256": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">F.14.\u00a0file_fdw</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/12/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u9ed8\u8ba4\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u9ed8\u8ba4\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.23.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/12/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text\n) SERVER pglog\nOPTIONS ( filename '/home/josh/data/log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/12/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/12/datatype-binary.html", "method": "same-major semantic node", "sha256": "54358e18fd1a2298785a999bb3c667dd511f4f6218dec142d1d26e4c328550bc", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/12/file-fdw.html", "method": "same-major semantic node", "sha256": "55d0e4b7f31fd8860e88f6caf734b7c220af4ff8affdce09cfccf537717f3ffd", "language": "zh", "matched_nodes": ["#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/12/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/12/facts/0/label": "Interface family", "/versions/12/facts/0/value": "Foreign-data wrapper", "/versions/12/facts/1/label": "Handler or routine", "/versions/12/facts/2/label": "Recorded callbacks", "/versions/12/tables/0/title": "Registered interface handlers", "/versions/12/tables/1/title": "Documented options", "/versions/12/related/0/label": "Foreign-data wrapper catalog", "/versions/12/related/1/label": "Existing extension catalogue identity", "/versions/12/related/2/label": "Foreign Scan plan node", "/versions/12/sections/0/title": "Interface and capability boundaries", "/versions/12/sections/1/title": "File access boundary", "/versions/12/sections/2/title": "Registered implementation in core source", "/versions/12/tables/1/rows/6/name": "escape", "/versions/12/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/12/tables/0/rows/1/state": "No handler registered in this build", "/versions/12/tables/0/rows/2/state": "No handler registered in this build", "/versions/12/tables/0/rows/3/state": "No handler registered in this build", "/versions/12/tables/0/rows/4/state": "No handler registered in this build", "/versions/12/tables/0/rows/5/state": "No handler registered in this build", "/versions/12/tables/0/rows/6/state": "No handler registered in this build", "/versions/12/tables/0/rows/7/state": "No handler registered in this build", "/versions/12/tables/0/rows/8/state": "No handler registered in this build", "/versions/12/tables/0/rows/9/state": "No handler registered in this build", "/versions/12/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/12/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/12/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/12/tables/0/rows/0/feature": "Scan rows", "/versions/12/tables/0/rows/5/feature": "Join path pushdown", "/versions/12/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/12/tables/0/rows/7/feature": "Batch insert", "/versions/12/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/12/tables/0/rows/9/feature": "Import schema", "/versions/12/tables/0/columns/0/label": "Interface operation", "/versions/12/tables/0/columns/1/label": "Source observation", "/versions/12/tables/0/columns/2/label": "Callback", "/versions/12/tables/0/columns/3/label": "Implementation", "/versions/12/tables/1/columns/0/label": "Option", "/versions/12/tables/1/columns/1/label": "Same-version definition", "/versions/12/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/12/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/12/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/12/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/12/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/12/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/12/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/12/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/12/tables/1/rows/8/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/12/tables/1/rows/9/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/12/tables/1/rows/10/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/12/tables/0/rows/1/implementation": "Not registered", "/versions/12/tables/0/rows/2/implementation": "Not registered", "/versions/12/tables/0/rows/3/implementation": "Not registered", "/versions/12/tables/0/rows/4/implementation": "Not registered", "/versions/12/tables/0/rows/5/implementation": "Not registered", "/versions/12/tables/0/rows/6/implementation": "Not registered", "/versions/12/tables/0/rows/7/implementation": "Not registered", "/versions/12/tables/0/rows/8/implementation": "Not registered", "/versions/12/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "1802e3857396173103b063c7141aad25e6a037e61d4ee37263f924babb00e81c"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "e3667962550d31793ff1cfb28056ac711b0cfd15ff9da272242f5b472d17c327", "manual_language": "zh", "runtime_verified": false}, "13": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=13", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=13", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 13.23 source archive", "label": "13.23", "major": "13", "channel": "historical", "revision": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6", "source_url": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/13/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 13 English manual", "sha256": "879b7dc818754f3798684b46337ab1dd043e5dc5a2d144d4be2311ac8aa0be21", "language": "en", "original_url": "/docs/13/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "line": 172, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:172", "sha256": "40594c4cbbae424ce0018f63b098c26a7b975a8ae4982d7cae481548d23c98d7", "archive_sha256": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">F.14.\u00a0file_fdw</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/13/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u9ed8\u8ba4\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u9ed8\u8ba4\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.23.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/13/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/13/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/13/datatype-binary.html", "method": "same-major semantic node", "sha256": "ec3d26c4e146c0e4a4ded84b7aa5c9272323546b759fbd7b591fa00ad08c6aa8", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/13/file-fdw.html", "method": "same-major semantic node", "sha256": "ed1861bfe9d90a981d65434bf8769c57aa943838555ca16355d867e3821b1993", "language": "zh", "matched_nodes": ["#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/13/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/13/facts/0/label": "Interface family", "/versions/13/facts/0/value": "Foreign-data wrapper", "/versions/13/facts/1/label": "Handler or routine", "/versions/13/facts/2/label": "Recorded callbacks", "/versions/13/tables/0/title": "Registered interface handlers", "/versions/13/tables/1/title": "Documented options", "/versions/13/related/0/label": "Foreign-data wrapper catalog", "/versions/13/related/1/label": "Existing extension catalogue identity", "/versions/13/related/2/label": "Foreign Scan plan node", "/versions/13/sections/0/title": "Interface and capability boundaries", "/versions/13/sections/1/title": "File access boundary", "/versions/13/sections/2/title": "Registered implementation in core source", "/versions/13/tables/1/rows/6/name": "escape", "/versions/13/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/13/tables/0/rows/1/state": "No handler registered in this build", "/versions/13/tables/0/rows/2/state": "No handler registered in this build", "/versions/13/tables/0/rows/3/state": "No handler registered in this build", "/versions/13/tables/0/rows/4/state": "No handler registered in this build", "/versions/13/tables/0/rows/5/state": "No handler registered in this build", "/versions/13/tables/0/rows/6/state": "No handler registered in this build", "/versions/13/tables/0/rows/7/state": "No handler registered in this build", "/versions/13/tables/0/rows/8/state": "No handler registered in this build", "/versions/13/tables/0/rows/9/state": "No handler registered in this build", "/versions/13/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/13/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/13/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/13/tables/0/rows/0/feature": "Scan rows", "/versions/13/tables/0/rows/5/feature": "Join path pushdown", "/versions/13/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/13/tables/0/rows/7/feature": "Batch insert", "/versions/13/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/13/tables/0/rows/9/feature": "Import schema", "/versions/13/tables/0/columns/0/label": "Interface operation", "/versions/13/tables/0/columns/1/label": "Source observation", "/versions/13/tables/0/columns/2/label": "Callback", "/versions/13/tables/0/columns/3/label": "Implementation", "/versions/13/tables/1/columns/0/label": "Option", "/versions/13/tables/1/columns/1/label": "Same-version definition", "/versions/13/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/13/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/13/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/13/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/13/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/13/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/13/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/13/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/13/tables/1/rows/8/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/13/tables/1/rows/9/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/13/tables/1/rows/10/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/13/tables/0/rows/1/implementation": "Not registered", "/versions/13/tables/0/rows/2/implementation": "Not registered", "/versions/13/tables/0/rows/3/implementation": "Not registered", "/versions/13/tables/0/rows/4/implementation": "Not registered", "/versions/13/tables/0/rows/5/implementation": "Not registered", "/versions/13/tables/0/rows/6/implementation": "Not registered", "/versions/13/tables/0/rows/7/implementation": "Not registered", "/versions/13/tables/0/rows/8/implementation": "Not registered", "/versions/13/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "9082a46c6702ba00f9f2ca03f21c38dfaa80952b772e2f212a8dee36c4485087"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "e3667962550d31793ff1cfb28056ac711b0cfd15ff9da272242f5b472d17c327", "manual_language": "zh", "runtime_verified": false}, "14": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=14", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=14", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 14.24 source archive", "label": "14.24", "major": "14", "channel": "stable", "revision": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897", "source_url": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/14/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 14 English manual", "sha256": "5f2338a8cfc33e89d34c5bf764b6aee9a1bac5a3b352094ed64df6cb1033eb76", "language": "en", "original_url": "/docs/14/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "line": 172, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:172", "sha256": "fcd93dad4583cb3d29b4b02b002872fc6d5eab7ed6cc0c76e4a0293da819e5f2", "archive_sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">F.14.\u00a0file_fdw</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/14/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.23.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/14/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"20.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text,\n  leader_pid integer,\n  query_id bigint\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/14/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/14/datatype-binary.html", "method": "same-major semantic node", "sha256": "88f726014eed91b13634c0119518a94c46711deb45fef815d5fd698dd69a83e1", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/14/file-fdw.html", "method": "same-major semantic node", "sha256": "3e212e07f017cbefb36c0f5b48315677f2dcfb5b24b8dd0409bab856eb9212ea", "language": "zh", "matched_nodes": ["#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/14/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/14/facts/0/label": "Interface family", "/versions/14/facts/0/value": "Foreign-data wrapper", "/versions/14/facts/1/label": "Handler or routine", "/versions/14/facts/2/label": "Recorded callbacks", "/versions/14/tables/0/title": "Registered interface handlers", "/versions/14/tables/1/title": "Documented options", "/versions/14/related/0/label": "Foreign-data wrapper catalog", "/versions/14/related/1/label": "Existing extension catalogue identity", "/versions/14/related/2/label": "Foreign Scan plan node", "/versions/14/sections/0/title": "Interface and capability boundaries", "/versions/14/sections/1/title": "File access boundary", "/versions/14/sections/2/title": "Registered implementation in core source", "/versions/14/tables/1/rows/6/name": "escape", "/versions/14/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/14/tables/0/rows/1/state": "No handler registered in this build", "/versions/14/tables/0/rows/2/state": "No handler registered in this build", "/versions/14/tables/0/rows/3/state": "No handler registered in this build", "/versions/14/tables/0/rows/4/state": "No handler registered in this build", "/versions/14/tables/0/rows/5/state": "No handler registered in this build", "/versions/14/tables/0/rows/6/state": "No handler registered in this build", "/versions/14/tables/0/rows/7/state": "No handler registered in this build", "/versions/14/tables/0/rows/8/state": "No handler registered in this build", "/versions/14/tables/0/rows/9/state": "No handler registered in this build", "/versions/14/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/14/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/14/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/14/tables/0/rows/0/feature": "Scan rows", "/versions/14/tables/0/rows/5/feature": "Join path pushdown", "/versions/14/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/14/tables/0/rows/7/feature": "Batch insert", "/versions/14/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/14/tables/0/rows/9/feature": "Import schema", "/versions/14/tables/0/columns/0/label": "Interface operation", "/versions/14/tables/0/columns/1/label": "Source observation", "/versions/14/tables/0/columns/2/label": "Callback", "/versions/14/tables/0/columns/3/label": "Implementation", "/versions/14/tables/1/columns/0/label": "Option", "/versions/14/tables/1/columns/1/label": "Same-version definition", "/versions/14/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/14/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/14/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/14/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/14/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/14/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/14/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/14/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/14/tables/1/rows/8/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/14/tables/1/rows/9/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/14/tables/1/rows/10/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/14/tables/0/rows/1/implementation": "Not registered", "/versions/14/tables/0/rows/2/implementation": "Not registered", "/versions/14/tables/0/rows/3/implementation": "Not registered", "/versions/14/tables/0/rows/4/implementation": "Not registered", "/versions/14/tables/0/rows/5/implementation": "Not registered", "/versions/14/tables/0/rows/6/implementation": "Not registered", "/versions/14/tables/0/rows/7/implementation": "Not registered", "/versions/14/tables/0/rows/8/implementation": "Not registered", "/versions/14/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "0b1ceb62a3026220d6760160400791e8e058dbb423eed151d388f931e2429ee5"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "e3667962550d31793ff1cfb28056ac711b0cfd15ff9da272242f5b472d17c327", "manual_language": "zh", "runtime_verified": false}, "15": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=15", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=15", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 15.19 source archive", "label": "15.19", "major": "15", "channel": "stable", "revision": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89", "source_url": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/15/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 15 English manual", "sha256": "a4c229bbafc6b16e98525250700926b2aff4e8a56419b0fa836773f509bf4c1e", "language": "en", "original_url": "/docs/15/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "line": 172, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:172", "sha256": "ae6742d752f167ba254c82fe57b6dca11653e4a04b753f494981ca4b9293bb83", "archive_sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\">F.16.\u00a0file_fdw</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/15/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.25.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/15/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"20.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text,\n  leader_pid integer,\n  query_id bigint\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/15/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/15/datatype-binary.html", "method": "same-major semantic node", "sha256": "79e50f3d1eab61874853c87cb12ac60f59d7949b42a47ca956b835c79d135c01", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/15/file-fdw.html", "method": "same-major semantic node", "sha256": "b995ebdd016c9c5efb63ff3a88d843ae5c52ae08e10567f89d8e32b6a04a9c85", "language": "zh", "matched_nodes": ["#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/15/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/15/facts/0/label": "Interface family", "/versions/15/facts/0/value": "Foreign-data wrapper", "/versions/15/facts/1/label": "Handler or routine", "/versions/15/facts/2/label": "Recorded callbacks", "/versions/15/tables/0/title": "Registered interface handlers", "/versions/15/tables/1/title": "Documented options", "/versions/15/related/0/label": "Foreign-data wrapper catalog", "/versions/15/related/1/label": "Existing extension catalogue identity", "/versions/15/related/2/label": "Foreign Scan plan node", "/versions/15/sections/0/title": "Interface and capability boundaries", "/versions/15/sections/1/title": "File access boundary", "/versions/15/sections/2/title": "Registered implementation in core source", "/versions/15/tables/1/rows/6/name": "escape", "/versions/15/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/15/tables/0/rows/1/state": "No handler registered in this build", "/versions/15/tables/0/rows/2/state": "No handler registered in this build", "/versions/15/tables/0/rows/3/state": "No handler registered in this build", "/versions/15/tables/0/rows/4/state": "No handler registered in this build", "/versions/15/tables/0/rows/5/state": "No handler registered in this build", "/versions/15/tables/0/rows/6/state": "No handler registered in this build", "/versions/15/tables/0/rows/7/state": "No handler registered in this build", "/versions/15/tables/0/rows/8/state": "No handler registered in this build", "/versions/15/tables/0/rows/9/state": "No handler registered in this build", "/versions/15/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/15/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/15/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/15/tables/0/rows/0/feature": "Scan rows", "/versions/15/tables/0/rows/5/feature": "Join path pushdown", "/versions/15/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/15/tables/0/rows/7/feature": "Batch insert", "/versions/15/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/15/tables/0/rows/9/feature": "Import schema", "/versions/15/tables/0/columns/0/label": "Interface operation", "/versions/15/tables/0/columns/1/label": "Source observation", "/versions/15/tables/0/columns/2/label": "Callback", "/versions/15/tables/0/columns/3/label": "Implementation", "/versions/15/tables/1/columns/0/label": "Option", "/versions/15/tables/1/columns/1/label": "Same-version definition", "/versions/15/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/15/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/15/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/15/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/15/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/15/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/15/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/15/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/15/tables/1/rows/8/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/15/tables/1/rows/9/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/15/tables/1/rows/10/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/15/tables/0/rows/1/implementation": "Not registered", "/versions/15/tables/0/rows/2/implementation": "Not registered", "/versions/15/tables/0/rows/3/implementation": "Not registered", "/versions/15/tables/0/rows/4/implementation": "Not registered", "/versions/15/tables/0/rows/5/implementation": "Not registered", "/versions/15/tables/0/rows/6/implementation": "Not registered", "/versions/15/tables/0/rows/7/implementation": "Not registered", "/versions/15/tables/0/rows/8/implementation": "Not registered", "/versions/15/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "e195072528dc615ac6f9c4192bd183f686abd5b6ff70ebaf60b9200907614c5a"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "e3667962550d31793ff1cfb28056ac711b0cfd15ff9da272242f5b472d17c327", "manual_language": "zh", "runtime_verified": false}, "16": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u9ed8\u8ba4", "definition": "\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e COPY \u7684 DEFAULT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=16", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=16", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 16.15 source archive", "label": "16.15", "major": "16", "channel": "stable", "revision": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed", "source_url": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/16/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 16 English manual", "sha256": "600f45273de1cab3a84df14cff52f13be80dc82c8dd7848989a4beb2c8e92d15", "language": "en", "original_url": "/docs/16/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "line": 174, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:174", "sha256": "b545acfbffc7191a48bdf1364e68530531c4e24e06cd5bd7576732e76c6ad63f", "archive_sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">F.16.\u00a0file_fdw \u2014 \u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/16/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u9ed8\u8ba4</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DEFAULT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.26.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/16/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"20.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text,\n  leader_pid integer,\n  query_id bigint\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/16/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/16/catalog-pg-amproc.html", "method": "same-major semantic node", "sha256": "bd6afb30bbf4c65c31030954168bc14f2e9c84a294ae7e96be2f04b4dcb20a16", "language": "zh", "matched_nodes": ["#CATALOG-PG-AMPROC/p[5]/span[2]/span[0]"]}, {"url": "/docs/16/datatype-binary.html", "method": "same-major semantic node", "sha256": "c53a656ed712cd5b7356047e39e0d95f22cbb6f449cfc2e563a01f1af25bbfd5", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/16/file-fdw.html", "method": "same-major semantic node", "sha256": "f9821c45b3717aae7bdbc1936b7f53610e3aac77533a736d34330e4428156f2a", "language": "zh", "matched_nodes": ["#FILE-FDW/div[0]", "#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[19]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/16/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/16/facts/0/label": "Interface family", "/versions/16/facts/0/value": "Foreign-data wrapper", "/versions/16/facts/1/label": "Handler or routine", "/versions/16/facts/2/label": "Recorded callbacks", "/versions/16/tables/0/title": "Registered interface handlers", "/versions/16/tables/1/title": "Documented options", "/versions/16/related/0/label": "Foreign-data wrapper catalog", "/versions/16/related/1/label": "Existing extension catalogue identity", "/versions/16/related/2/label": "Foreign Scan plan node", "/versions/16/sections/0/title": "Interface and capability boundaries", "/versions/16/sections/1/title": "File access boundary", "/versions/16/sections/2/title": "Registered implementation in core source", "/versions/16/tables/1/rows/6/name": "escape", "/versions/16/tables/1/rows/8/name": "default", "/versions/16/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/16/tables/0/rows/1/state": "No handler registered in this build", "/versions/16/tables/0/rows/2/state": "No handler registered in this build", "/versions/16/tables/0/rows/3/state": "No handler registered in this build", "/versions/16/tables/0/rows/4/state": "No handler registered in this build", "/versions/16/tables/0/rows/5/state": "No handler registered in this build", "/versions/16/tables/0/rows/6/state": "No handler registered in this build", "/versions/16/tables/0/rows/7/state": "No handler registered in this build", "/versions/16/tables/0/rows/8/state": "No handler registered in this build", "/versions/16/tables/0/rows/9/state": "No handler registered in this build", "/versions/16/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/16/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/16/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/16/tables/0/rows/0/feature": "Scan rows", "/versions/16/tables/0/rows/5/feature": "Join path pushdown", "/versions/16/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/16/tables/0/rows/7/feature": "Batch insert", "/versions/16/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/16/tables/0/rows/9/feature": "Import schema", "/versions/16/tables/0/columns/0/label": "Interface operation", "/versions/16/tables/0/columns/1/label": "Source observation", "/versions/16/tables/0/columns/2/label": "Callback", "/versions/16/tables/0/columns/3/label": "Implementation", "/versions/16/tables/1/columns/0/label": "Option", "/versions/16/tables/1/columns/1/label": "Same-version definition", "/versions/16/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/16/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/16/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/16/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/16/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/16/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/16/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/16/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/16/tables/1/rows/8/definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option.", "/versions/16/tables/1/rows/9/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/16/tables/1/rows/10/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/16/tables/1/rows/11/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/16/tables/0/rows/1/implementation": "Not registered", "/versions/16/tables/0/rows/2/implementation": "Not registered", "/versions/16/tables/0/rows/3/implementation": "Not registered", "/versions/16/tables/0/rows/4/implementation": "Not registered", "/versions/16/tables/0/rows/5/implementation": "Not registered", "/versions/16/tables/0/rows/6/implementation": "Not registered", "/versions/16/tables/0/rows/7/implementation": "Not registered", "/versions/16/tables/0/rows/8/implementation": "Not registered", "/versions/16/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "fdead85bb4e6df3c725f3acb453a54210274bb5a4e81094dd466201bc49c805b"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "default", "definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "ec8801ddff287a4296f6ec9e1e66865681d20d3b9e524553fc6caf16973011bd", "manual_language": "zh", "runtime_verified": false}, "17": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u9ed8\u8ba4", "definition": "\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e COPY \u7684 DEFAULT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=17", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=17", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 17.11 source archive", "label": "17.11", "major": "17", "channel": "stable", "revision": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979", "source_url": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/17/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 17 English manual", "sha256": "91d02e8e196428b1e6ab1eea2547f1e746ef2aad63e5a1e613d2efad536658ad", "language": "en", "original_url": "/docs/17/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "line": 174, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:174", "sha256": "35aff72d3d675e07289b3e6f9b9c7b062b02133cb8de67efacd297258b80ad22", "archive_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">F.15.\u00a0file_fdw \u2014 \u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/17/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u9ed8\u8ba4</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DEFAULT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.25.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/17/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text,\n  leader_pid integer,\n  query_id bigint\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n<div class=\"example\" id=\"id-1.11.7.25.15\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.2.\u00a0\u521b\u5efa\u5177\u6709\u5217\u9009\u9879\u7684\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\">\u8981\u4e3a\u67d0\u4e00\u5217\u8bbe\u7f6e<code class=\"literal\">force_null</code>\u9009\u9879\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">OPTIONS</code>\u5173\u952e\u5b57\u3002</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE films (\n code char(5) NOT NULL,\n title text NOT NULL,\n rating text OPTIONS (force_null 'true')\n) SERVER film_server\nOPTIONS ( filename 'films/db.csv', format 'csv' );\n</pre>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/17/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/17/catalog-pg-amproc.html", "method": "same-major semantic node", "sha256": "c039c404dbd4adbc2eeb98c0a606a7914682739fad4bdcd2c789c199de950926", "language": "zh", "matched_nodes": ["#CATALOG-PG-AMPROC/p[5]/span[2]/span[0]"]}, {"url": "/docs/17/datatype-binary.html", "method": "same-major semantic node", "sha256": "2cc00951bcf225f141ef63370c8b23f919bc1433f63b1367b6bd3b6b0b2f9233", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/17/file-fdw.html", "method": "same-major semantic node", "sha256": "5466e6a340f312ba75dfdde15189151da10061ef14dc719e4f5346a99f59dec5", "language": "zh", "matched_nodes": ["#FILE-FDW/div[0]", "#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[15]/div[1]/p[0]", "#FILE-FDW/div[15]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[19]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/17/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/17/facts/0/label": "Interface family", "/versions/17/facts/0/value": "Foreign-data wrapper", "/versions/17/facts/1/label": "Handler or routine", "/versions/17/facts/2/label": "Recorded callbacks", "/versions/17/tables/0/title": "Registered interface handlers", "/versions/17/tables/1/title": "Documented options", "/versions/17/related/0/label": "Foreign-data wrapper catalog", "/versions/17/related/1/label": "Existing extension catalogue identity", "/versions/17/related/2/label": "Foreign Scan plan node", "/versions/17/sections/0/title": "Interface and capability boundaries", "/versions/17/sections/1/title": "File access boundary", "/versions/17/sections/2/title": "Registered implementation in core source", "/versions/17/tables/1/rows/6/name": "escape", "/versions/17/tables/1/rows/8/name": "default", "/versions/17/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/17/tables/0/rows/1/state": "No handler registered in this build", "/versions/17/tables/0/rows/2/state": "No handler registered in this build", "/versions/17/tables/0/rows/3/state": "No handler registered in this build", "/versions/17/tables/0/rows/4/state": "No handler registered in this build", "/versions/17/tables/0/rows/5/state": "No handler registered in this build", "/versions/17/tables/0/rows/6/state": "No handler registered in this build", "/versions/17/tables/0/rows/7/state": "No handler registered in this build", "/versions/17/tables/0/rows/8/state": "No handler registered in this build", "/versions/17/tables/0/rows/9/state": "No handler registered in this build", "/versions/17/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/17/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/17/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/17/tables/0/rows/0/feature": "Scan rows", "/versions/17/tables/0/rows/5/feature": "Join path pushdown", "/versions/17/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/17/tables/0/rows/7/feature": "Batch insert", "/versions/17/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/17/tables/0/rows/9/feature": "Import schema", "/versions/17/tables/0/columns/0/label": "Interface operation", "/versions/17/tables/0/columns/1/label": "Source observation", "/versions/17/tables/0/columns/2/label": "Callback", "/versions/17/tables/0/columns/3/label": "Implementation", "/versions/17/tables/1/columns/0/label": "Option", "/versions/17/tables/1/columns/1/label": "Same-version definition", "/versions/17/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/17/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/17/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/17/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/17/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/17/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/17/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/17/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/17/tables/1/rows/8/definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option.", "/versions/17/tables/1/rows/9/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/17/tables/1/rows/10/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/17/tables/1/rows/11/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/17/tables/0/rows/1/implementation": "Not registered", "/versions/17/tables/0/rows/2/implementation": "Not registered", "/versions/17/tables/0/rows/3/implementation": "Not registered", "/versions/17/tables/0/rows/4/implementation": "Not registered", "/versions/17/tables/0/rows/5/implementation": "Not registered", "/versions/17/tables/0/rows/6/implementation": "Not registered", "/versions/17/tables/0/rows/7/implementation": "Not registered", "/versions/17/tables/0/rows/8/implementation": "Not registered", "/versions/17/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "6c136644b9a6d29ba1eeb2f0f8e3de53b18878e893068491efc0cbbd23c76ee5"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "default", "definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "ec8801ddff287a4296f6ec9e1e66865681d20d3b9e524553fc6caf16973011bd", "manual_language": "zh", "runtime_verified": false}, "18": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u9ed8\u8ba4", "definition": "\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e COPY \u7684 DEFAULT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "on_error", "definition": "\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u9047\u5230\u9519\u8bef\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e0e COPY \u7684 ON_ERROR \u9009\u9879\u76f8\u540c\u3002"}, {"name": "reject_limit", "definition": "\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u53ef\u5bb9\u5fcd\u7684\u6700\u5927\u9519\u8bef\u6570\uff0c\u4e0e COPY \u7684 REJECT_LIMIT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "log_verbosity", "definition": "\u6307\u5b9a file_fdw \u53d1\u51fa\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff0c\u4e0e COPY \u7684 LOG_VERBOSITY \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=18", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=18", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 18.6 source archive", "label": "18.6", "major": "18", "channel": "stable", "revision": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/18/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 18 English manual", "sha256": "5da35cee02e73ec6656a2020d8351046cad9283a137b45064bee58f1ff7eb787", "language": "en", "original_url": "/docs/18/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "line": 183, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:183", "sha256": "d79ec21c08be6a806b0710aab09698678ddb24103d3470702e66ee1523432125", "archive_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">F.15.\u00a0file_fdw \u2014 \u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/18/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u9ed8\u8ba4</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DEFAULT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">on_error</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u9047\u5230\u9519\u8bef\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ON_ERROR</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">reject_limit</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u53ef\u5bb9\u5fcd\u7684\u6700\u5927\u9519\u8bef\u6570\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">REJECT_LIMIT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">log_verbosity</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"literal\">file_fdw</code>\u53d1\u51fa\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">LOG_VERBOSITY</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.25.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/18/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text,\n  leader_pid integer,\n  query_id bigint\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n<div class=\"example\" id=\"id-1.11.7.25.15\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.2.\u00a0\u521b\u5efa\u5177\u6709\u5217\u9009\u9879\u7684\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\">\u8981\u4e3a\u67d0\u4e00\u5217\u8bbe\u7f6e<code class=\"literal\">force_null</code>\u9009\u9879\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">OPTIONS</code>\u5173\u952e\u5b57\u3002</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE films (\n code char(5) NOT NULL,\n title text NOT NULL,\n rating text OPTIONS (force_null 'true')\n) SERVER film_server\nOPTIONS ( filename 'films/db.csv', format 'csv' );\n</pre>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/18/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/catalog-pg-amproc.html", "method": "same-major semantic node", "sha256": "c1b7d16e812991b4d5fb68085a27c8ff82aeaffa34afda56c5837f9b7588187c", "language": "zh", "matched_nodes": ["#CATALOG-PG-AMPROC/p[5]/span[2]/span[0]"]}, {"url": "/docs/18/datatype-binary.html", "method": "same-major semantic node", "sha256": "c920ef4acee3e68440b2da39e5417247a1e7d0251c0bb2bf6c929e0a1e5749fd", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/18/file-fdw.html", "method": "same-major semantic node", "sha256": "406657f6908f1afd91cef4891e43e779e4d23d4c55e07754cb68dd75cc848a05", "language": "zh", "matched_nodes": ["#FILE-FDW/div[0]", "#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[15]/div[1]/p[0]", "#FILE-FDW/div[15]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[19]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[21]", "#FILE-FDW/div[4]/dl[0]/dd[23]", "#FILE-FDW/div[4]/dl[0]/dd[25]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/18/facts/0/label": "Interface family", "/versions/18/facts/0/value": "Foreign-data wrapper", "/versions/18/facts/1/label": "Handler or routine", "/versions/18/facts/2/label": "Recorded callbacks", "/versions/18/tables/0/title": "Registered interface handlers", "/versions/18/tables/1/title": "Documented options", "/versions/18/related/0/label": "Foreign-data wrapper catalog", "/versions/18/related/1/label": "Existing extension catalogue identity", "/versions/18/related/2/label": "Foreign Scan plan node", "/versions/18/sections/0/title": "Interface and capability boundaries", "/versions/18/sections/1/title": "File access boundary", "/versions/18/sections/2/title": "Registered implementation in core source", "/versions/18/tables/1/rows/6/name": "escape", "/versions/18/tables/1/rows/8/name": "default", "/versions/18/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/18/tables/0/rows/1/state": "No handler registered in this build", "/versions/18/tables/0/rows/2/state": "No handler registered in this build", "/versions/18/tables/0/rows/3/state": "No handler registered in this build", "/versions/18/tables/0/rows/4/state": "No handler registered in this build", "/versions/18/tables/0/rows/5/state": "No handler registered in this build", "/versions/18/tables/0/rows/6/state": "No handler registered in this build", "/versions/18/tables/0/rows/7/state": "No handler registered in this build", "/versions/18/tables/0/rows/8/state": "No handler registered in this build", "/versions/18/tables/0/rows/9/state": "No handler registered in this build", "/versions/18/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/18/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/18/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/18/tables/0/rows/0/feature": "Scan rows", "/versions/18/tables/0/rows/5/feature": "Join path pushdown", "/versions/18/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/18/tables/0/rows/7/feature": "Batch insert", "/versions/18/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/18/tables/0/rows/9/feature": "Import schema", "/versions/18/tables/0/columns/0/label": "Interface operation", "/versions/18/tables/0/columns/1/label": "Source observation", "/versions/18/tables/0/columns/2/label": "Callback", "/versions/18/tables/0/columns/3/label": "Implementation", "/versions/18/tables/1/columns/0/label": "Option", "/versions/18/tables/1/columns/1/label": "Same-version definition", "/versions/18/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/18/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/18/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/18/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/18/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/18/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/18/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/18/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/18/tables/1/rows/8/definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option.", "/versions/18/tables/1/rows/9/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/18/tables/1/rows/10/definition": "Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option.", "/versions/18/tables/1/rows/11/definition": "Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option.", "/versions/18/tables/1/rows/12/definition": "Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option.", "/versions/18/tables/1/rows/13/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/18/tables/1/rows/14/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/18/tables/0/rows/1/implementation": "Not registered", "/versions/18/tables/0/rows/2/implementation": "Not registered", "/versions/18/tables/0/rows/3/implementation": "Not registered", "/versions/18/tables/0/rows/4/implementation": "Not registered", "/versions/18/tables/0/rows/5/implementation": "Not registered", "/versions/18/tables/0/rows/6/implementation": "Not registered", "/versions/18/tables/0/rows/7/implementation": "Not registered", "/versions/18/tables/0/rows/8/implementation": "Not registered", "/versions/18/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "5783145c5846ef9c1ce0e5cd3f344d1f62fe65c127a7eb9502b49ad3fe90fc19"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "default", "definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "on_error", "definition": "Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option."}, {"name": "reject_limit", "definition": "Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option."}, {"name": "log_verbosity", "definition": "Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "3a50d8e658a12e9ec3405a8fd6dae6ec70a2fe3837297394492fb97a95b01306", "manual_language": "zh", "runtime_verified": false}, "19": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u662f\u5426\u8df3\u8fc7\u6807\u9898\u884c\uff0c\u6216\u8981\u8df3\u8fc7\u591a\u5c11\u884c\u6807\u9898\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u9ed8\u8ba4", "definition": "\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e COPY \u7684 DEFAULT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "on_error", "definition": "\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u9047\u5230\u9519\u8bef\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e0e COPY \u7684 ON_ERROR \u9009\u9879\u76f8\u540c\u3002"}, {"name": "reject_limit", "definition": "\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u53ef\u5bb9\u5fcd\u7684\u6700\u5927\u9519\u8bef\u6570\uff0c\u4e0e COPY \u7684 REJECT_LIMIT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "log_verbosity", "definition": "\u6307\u5b9a file_fdw \u53d1\u51fa\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff0c\u4e0e COPY \u7684 LOG_VERBOSITY \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=19", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=19", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 19beta4 source archive", "label": "19beta4", "major": "19", "channel": "preview", "revision": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86", "source_url": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/19/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 19 English manual", "sha256": "a292666e5a6ab0a2f62cf0ce333ab09c5b86be22919ba1edb8be06472245c5ee", "language": "en", "original_url": "/docs/19/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "line": 183, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:183", "sha256": "00d45cce47466fb799f1285fb78113446eab16480e00c3fbfeae9a9a3439a1ca", "archive_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">F.15.\u00a0file_fdw \u2014 \u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/19/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u662f\u5426\u8df3\u8fc7\u6807\u9898\u884c\uff0c\u6216\u8981\u8df3\u8fc7\u591a\u5c11\u884c\u6807\u9898\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u9ed8\u8ba4</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DEFAULT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">on_error</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u9047\u5230\u9519\u8bef\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ON_ERROR</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">reject_limit</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u53ef\u5bb9\u5fcd\u7684\u6700\u5927\u9519\u8bef\u6570\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">REJECT_LIMIT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">log_verbosity</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"literal\">file_fdw</code>\u53d1\u51fa\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">LOG_VERBOSITY</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u63a5\u53d7\u5e03\u5c14\u503c\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.25.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/19/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text,\n  leader_pid integer,\n  query_id bigint\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n<div class=\"example\" id=\"id-1.11.7.25.15\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.2.\u00a0\u521b\u5efa\u5177\u6709\u5217\u9009\u9879\u7684\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\">\u8981\u4e3a\u67d0\u4e00\u5217\u8bbe\u7f6e<code class=\"literal\">force_null</code>\u9009\u9879\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">OPTIONS</code>\u5173\u952e\u5b57\u3002</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE films (\n code char(5) NOT NULL,\n title text NOT NULL,\n rating text OPTIONS (force_null 'true')\n) SERVER film_server\nOPTIONS ( filename 'films/db.csv', format 'csv' );\n</pre>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/19/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/19/catalog-pg-amproc.html", "method": "same-major semantic node", "sha256": "2f3186b0cb3f1b6cdfb964d581bdf7719277157a11db7b3a207830efc10fcf6c", "language": "zh", "matched_nodes": ["#CATALOG-PG-AMPROC/p[5]/span[2]/span[0]"]}, {"url": "/docs/19/datatype-binary.html", "method": "same-major semantic node", "sha256": "de1a5398b49dbc17c3987d90f990b9fc8d16c5cec3ebcc8b44a90a719a69c6c1", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/19/file-fdw.html", "method": "same-major semantic node", "sha256": "dc024cbcfa19ca26b82cff4badf1663a203fb6c5144a98fa581d54395fb1fc86", "language": "zh", "matched_nodes": ["#FILE-FDW/div[0]", "#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[15]/div[1]/p[0]", "#FILE-FDW/div[15]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[19]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[21]", "#FILE-FDW/div[4]/dl[0]/dd[23]", "#FILE-FDW/div[4]/dl[0]/dd[25]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/19/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/19/facts/0/label": "Interface family", "/versions/19/facts/0/value": "Foreign-data wrapper", "/versions/19/facts/1/label": "Handler or routine", "/versions/19/facts/2/label": "Recorded callbacks", "/versions/19/tables/0/title": "Registered interface handlers", "/versions/19/tables/1/title": "Documented options", "/versions/19/related/0/label": "Foreign-data wrapper catalog", "/versions/19/related/1/label": "Existing extension catalogue identity", "/versions/19/related/2/label": "Foreign Scan plan node", "/versions/19/sections/0/title": "Interface and capability boundaries", "/versions/19/sections/1/title": "File access boundary", "/versions/19/sections/2/title": "Registered implementation in core source", "/versions/19/tables/1/rows/6/name": "escape", "/versions/19/tables/1/rows/8/name": "default", "/versions/19/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/19/tables/0/rows/1/state": "No handler registered in this build", "/versions/19/tables/0/rows/2/state": "No handler registered in this build", "/versions/19/tables/0/rows/3/state": "No handler registered in this build", "/versions/19/tables/0/rows/4/state": "No handler registered in this build", "/versions/19/tables/0/rows/5/state": "No handler registered in this build", "/versions/19/tables/0/rows/6/state": "No handler registered in this build", "/versions/19/tables/0/rows/7/state": "No handler registered in this build", "/versions/19/tables/0/rows/8/state": "No handler registered in this build", "/versions/19/tables/0/rows/9/state": "No handler registered in this build", "/versions/19/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/19/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/19/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/19/tables/0/rows/0/feature": "Scan rows", "/versions/19/tables/0/rows/5/feature": "Join path pushdown", "/versions/19/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/19/tables/0/rows/7/feature": "Batch insert", "/versions/19/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/19/tables/0/rows/9/feature": "Import schema", "/versions/19/tables/0/columns/0/label": "Interface operation", "/versions/19/tables/0/columns/1/label": "Source observation", "/versions/19/tables/0/columns/2/label": "Callback", "/versions/19/tables/0/columns/3/label": "Implementation", "/versions/19/tables/1/columns/0/label": "Option", "/versions/19/tables/1/columns/1/label": "Same-version definition", "/versions/19/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/19/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/19/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/19/tables/1/rows/3/definition": "Specifies whether to skip a header line, or how many header lines to skip, the same as COPY 's HEADER option.", "/versions/19/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/19/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/19/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/19/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/19/tables/1/rows/8/definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option.", "/versions/19/tables/1/rows/9/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/19/tables/1/rows/10/definition": "Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option.", "/versions/19/tables/1/rows/11/definition": "Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option.", "/versions/19/tables/1/rows/12/definition": "Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option.", "/versions/19/tables/1/rows/13/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/19/tables/1/rows/14/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/19/tables/0/rows/1/implementation": "Not registered", "/versions/19/tables/0/rows/2/implementation": "Not registered", "/versions/19/tables/0/rows/3/implementation": "Not registered", "/versions/19/tables/0/rows/4/implementation": "Not registered", "/versions/19/tables/0/rows/5/implementation": "Not registered", "/versions/19/tables/0/rows/6/implementation": "Not registered", "/versions/19/tables/0/rows/7/implementation": "Not registered", "/versions/19/tables/0/rows/8/implementation": "Not registered", "/versions/19/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "ff141d685fa7a9114084b9d483b7e612933cd6cf0b076bc29faaa77e2c637f83"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether to skip a header line, or how many header lines to skip, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "default", "definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "on_error", "definition": "Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option."}, {"name": "reject_limit", "definition": "Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option."}, {"name": "log_verbosity", "definition": "Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "e872a000cbfc81be3c44b9a665e3ea7226545043214ef722efa0b01366fb56d4", "manual_language": "zh", "runtime_verified": false}, "20": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u662f\u5426\u8df3\u8fc7\u6807\u9898\u884c\uff0c\u6216\u8981\u8df3\u8fc7\u591a\u5c11\u884c\u6807\u9898\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u9ed8\u8ba4", "definition": "\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e COPY \u7684 DEFAULT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "on_error", "definition": "\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u9047\u5230\u9519\u8bef\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e0e COPY \u7684 ON_ERROR \u9009\u9879\u76f8\u540c\u3002"}, {"name": "reject_limit", "definition": "\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u53ef\u5bb9\u5fcd\u7684\u6700\u5927\u9519\u8bef\u6570\uff0c\u4e0e COPY \u7684 REJECT_LIMIT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "log_verbosity", "definition": "\u6307\u5b9a file_fdw \u53d1\u51fa\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff0c\u4e0e COPY \u7684 LOG_VERBOSITY \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=20", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=20", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 20devel source archive", "label": "20devel", "major": "20", "channel": "devel", "revision": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41", "source_url": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "source_snapshot_utc": "26-Sep-2026 20:22"}, "sources": [{"url": "https://pg.center/docs/devel/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 20 English manual", "sha256": "14a0163b890979be72e7fce6b99b1803e73a3b259cc6ae2141d2f0b797acfd9d", "language": "en", "original_url": "/docs/devel/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "line": 183, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:183", "sha256": "6972e3c38c8fa7c716f948251c338d65901280c96d4f4fcf21f7ddbb71ec25fc", "archive_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">F.15.\u00a0file_fdw \u2014 \u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/devel/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u662f\u5426\u8df3\u8fc7\u6807\u9898\u884c\uff0c\u6216\u8981\u8df3\u8fc7\u591a\u5c11\u884c\u6807\u9898\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u9ed8\u8ba4</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DEFAULT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">on_error</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u9047\u5230\u9519\u8bef\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ON_ERROR</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">reject_limit</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u53ef\u5bb9\u5fcd\u7684\u6700\u5927\u9519\u8bef\u6570\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">REJECT_LIMIT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">log_verbosity</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"literal\">file_fdw</code>\u53d1\u51fa\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">LOG_VERBOSITY</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u63a5\u53d7\u5e03\u5c14\u503c\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.25.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/devel/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text,\n  leader_pid integer,\n  query_id bigint\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n<div class=\"example\" id=\"id-1.11.7.25.15\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.2.\u00a0\u521b\u5efa\u5177\u6709\u5217\u9009\u9879\u7684\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\">\u8981\u4e3a\u67d0\u4e00\u5217\u8bbe\u7f6e<code class=\"literal\">force_null</code>\u9009\u9879\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">OPTIONS</code>\u5173\u952e\u5b57\u3002</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE films (\n code char(5) NOT NULL,\n title text NOT NULL,\n rating text OPTIONS (force_null 'true')\n) SERVER film_server\nOPTIONS ( filename 'films/db.csv', format 'csv' );\n</pre>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/devel/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/devel/catalog-pg-amproc.html", "method": "same-major semantic node", "sha256": "adca05c5ff2b94562e292f0b81459187e8a41a57ab5781a5f22d721ec40aaa6c", "language": "zh", "matched_nodes": ["#CATALOG-PG-AMPROC/p[5]/span[2]/span[0]"]}, {"url": "/docs/devel/datatype-binary.html", "method": "same-major semantic node", "sha256": "502980e5d177177a9f1205fad403fe1c41c1925ebdb8fa3938f00718e3f5c1a3", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/devel/file-fdw.html", "method": "same-major semantic node", "sha256": "b0be7d9edf8897da648fbc1d91f5789de1d0d5dea0092cac3501868823aa79c4", "language": "zh", "matched_nodes": ["#FILE-FDW/div[0]", "#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[15]/div[1]/p[0]", "#FILE-FDW/div[15]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[19]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[21]", "#FILE-FDW/div[4]/dl[0]/dd[23]", "#FILE-FDW/div[4]/dl[0]/dd[25]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/summary": "Reads server-side files or program output through the foreign-data wrapper interface.", "/category": "Server files", "/versions/20/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/20/facts/0/label": "Interface family", "/versions/20/facts/0/value": "Foreign-data wrapper", "/versions/20/facts/1/label": "Handler or routine", "/versions/20/facts/2/label": "Recorded callbacks", "/versions/20/tables/0/title": "Registered interface handlers", "/versions/20/tables/1/title": "Documented options", "/versions/20/related/0/label": "Foreign-data wrapper catalog", "/versions/20/related/1/label": "Existing extension catalogue identity", "/versions/20/related/2/label": "Foreign Scan plan node", "/versions/20/sections/0/title": "Interface and capability boundaries", "/versions/20/sections/1/title": "File access boundary", "/versions/20/sections/2/title": "Registered implementation in core source", "/versions/20/tables/1/rows/6/name": "escape", "/versions/20/tables/1/rows/8/name": "default", "/versions/20/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/20/tables/0/rows/1/state": "No handler registered in this build", "/versions/20/tables/0/rows/2/state": "No handler registered in this build", "/versions/20/tables/0/rows/3/state": "No handler registered in this build", "/versions/20/tables/0/rows/4/state": "No handler registered in this build", "/versions/20/tables/0/rows/5/state": "No handler registered in this build", "/versions/20/tables/0/rows/6/state": "No handler registered in this build", "/versions/20/tables/0/rows/7/state": "No handler registered in this build", "/versions/20/tables/0/rows/8/state": "No handler registered in this build", "/versions/20/tables/0/rows/9/state": "No handler registered in this build", "/versions/20/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/20/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/20/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/20/tables/0/rows/0/feature": "Scan rows", "/versions/20/tables/0/rows/5/feature": "Join path pushdown", "/versions/20/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/20/tables/0/rows/7/feature": "Batch insert", "/versions/20/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/20/tables/0/rows/9/feature": "Import schema", "/versions/20/tables/0/columns/0/label": "Interface operation", "/versions/20/tables/0/columns/1/label": "Source observation", "/versions/20/tables/0/columns/2/label": "Callback", "/versions/20/tables/0/columns/3/label": "Implementation", "/versions/20/tables/1/columns/0/label": "Option", "/versions/20/tables/1/columns/1/label": "Same-version definition", "/versions/20/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/20/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/20/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/20/tables/1/rows/3/definition": "Specifies whether to skip a header line, or how many header lines to skip, the same as COPY 's HEADER option.", "/versions/20/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/20/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/20/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/20/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/20/tables/1/rows/8/definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option.", "/versions/20/tables/1/rows/9/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/20/tables/1/rows/10/definition": "Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option.", "/versions/20/tables/1/rows/11/definition": "Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option.", "/versions/20/tables/1/rows/12/definition": "Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option.", "/versions/20/tables/1/rows/13/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/20/tables/1/rows/14/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/20/tables/0/rows/1/implementation": "Not registered", "/versions/20/tables/0/rows/2/implementation": "Not registered", "/versions/20/tables/0/rows/3/implementation": "Not registered", "/versions/20/tables/0/rows/4/implementation": "Not registered", "/versions/20/tables/0/rows/5/implementation": "Not registered", "/versions/20/tables/0/rows/6/implementation": "Not registered", "/versions/20/tables/0/rows/7/implementation": "Not registered", "/versions/20/tables/0/rows/8/implementation": "Not registered", "/versions/20/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "0027a6bab086f280fbc29a273e38c8f8102478f239df977ab4435f3d4d419728"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether to skip a header line, or how many header lines to skip, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "default", "definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "on_error", "definition": "Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option."}, {"name": "reject_limit", "definition": "Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option."}, {"name": "log_verbosity", "definition": "Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "e872a000cbfc81be3c44b9a665e3ea7226545043214ef722efa0b01366fb56d4", "manual_language": "zh", "runtime_verified": false}}}, "snapshot": {"facts": [{"label": "\u63a5\u53e3\u7c7b\u522b", "value": "\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668"}, {"label": "\u5904\u7406\u51fd\u6570\u6216\u4f8b\u7a0b", "value": "file_fdw_handler"}, {"label": "\u8bb0\u5f55\u7684\u56de\u8c03", "value": "10"}], "tables": [{"key": "callbacks", "rows": [{"state": "\u5df2\u6ce8\u518c\u5904\u7406\u51fd\u6570\uff1b\u9002\u7528\u6761\u4ef6\u9650\u5236", "feature": "\u626b\u63cf\u6570\u636e\u884c", "callback": "IterateForeignScan", "implementation": "fileIterateForeignScan"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "INSERT", "callback": "ExecForeignInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "UPDATE", "callback": "ExecForeignUpdate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "DELETE", "callback": "ExecForeignDelete", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "TRUNCATE", "callback": "ExecForeignTruncate", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u8fde\u63a5\u8def\u5f84\u4e0b\u63a8", "callback": "GetForeignJoinPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u4e0a\u5c42\u8def\u5f84\uff0c\u5305\u62ec\u805a\u5408", "callback": "GetForeignUpperPaths", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u6279\u91cf\u63d2\u5165", "callback": "ExecForeignBatchInsert", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5f02\u6b65\u8ffd\u52a0\u6267\u884c", "callback": "ForeignAsyncRequest", "implementation": "\u672a\u767b\u8bb0"}, {"state": "\u6b64\u6784\u5efa\u672a\u6ce8\u518c\u5904\u7406\u51fd\u6570", "feature": "\u5bfc\u5165\u6a21\u5f0f", "callback": "ImportForeignSchema", "implementation": "\u672a\u767b\u8bb0"}], "title": "\u6ce8\u518c\u7684\u63a5\u53e3\u5904\u7406\u51fd\u6570", "columns": [{"key": "feature", "label": "\u63a5\u53e3\u64cd\u4f5c"}, {"key": "state", "label": "\u6e90\u7801\u89c2\u5bdf"}, {"key": "callback", "label": "\u56de\u8c03"}, {"key": "implementation", "label": "\u5b9e\u73b0"}]}, {"key": "options", "rows": [{"name": "filename", "definition": "\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a filename \u6216 program \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "program", "definition": "\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 COPY FROM PROGRAM \u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a program \u6216 filename \u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002"}, {"name": "format", "definition": "\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e COPY \u7684 FORMAT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "header", "definition": "\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e COPY \u7684 HEADER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "delimiter", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e COPY \u7684 DELIMITER \u9009\u9879\u76f8\u540c\u3002"}, {"name": "quote", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e COPY \u7684 QUOTE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u8f6c\u4e49", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e COPY \u7684 ESCAPE \u9009\u9879\u76f8\u540c\u3002"}, {"name": "null", "definition": "\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e COPY \u7684 NULL \u9009\u9879\u76f8\u540c\u3002"}, {"name": "\u9ed8\u8ba4", "definition": "\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e COPY \u7684 DEFAULT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "encoding", "definition": "\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e COPY \u7684 ENCODING \u9009\u9879\u76f8\u540c\u3002"}, {"name": "on_error", "definition": "\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u9047\u5230\u9519\u8bef\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e0e COPY \u7684 ON_ERROR \u9009\u9879\u76f8\u540c\u3002"}, {"name": "reject_limit", "definition": "\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u53ef\u5bb9\u5fcd\u7684\u6700\u5927\u9519\u8bef\u6570\uff0c\u4e0e COPY \u7684 REJECT_LIMIT \u9009\u9879\u76f8\u540c\u3002"}, {"name": "log_verbosity", "definition": "\u6307\u5b9a file_fdw \u53d1\u51fa\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff0c\u4e0e COPY \u7684 LOG_VERBOSITY \u9009\u9879\u76f8\u540c\u3002"}, {"name": "force_not_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 null \u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NOT_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}, {"name": "force_null", "definition": "\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a NULL \u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728 COPY \u7684 FORCE_NULL \u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002"}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "name", "label": "\u9009\u9879"}, {"key": "definition", "label": "\u540c\u7248\u672c\u5b9a\u4e49"}]}], "related": [{"url": "/wiki/catalog/pg_foreign_data_wrapper/?v=18", "label": "Foreign-data wrapper \u7cfb\u7edf\u76ee\u5f55"}, {"url": "/e/file_fdw/", "label": "\u65e2\u6709\u6269\u5c55\u76ee\u5f55\u6807\u8bc6"}, {"url": "/wiki/plan/foreign-scan/?v=18", "label": "Foreign Scan \u8ba1\u5212\u8282\u70b9"}], "release": {"ref": "PostgreSQL 18.6 source archive", "label": "18.6", "major": "18", "channel": "stable", "revision": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "source_snapshot_utc": ""}, "sources": [{"url": "https://pg.center/docs/18/file-fdw.html", "path": "file-fdw.html", "label": "PostgreSQL 18 English manual", "sha256": "5da35cee02e73ec6656a2020d8351046cad9283a137b45064bee58f1ff7eb787", "language": "en", "original_url": "/docs/18/file-fdw.html"}, {"url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "line": 183, "path": "contrib/file_fdw/file_fdw.c", "label": "contrib/file_fdw/file_fdw.c:183", "sha256": "d79ec21c08be6a806b0710aab09698678ddb24103d3470702e66ee1523432125", "archive_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}], "sections": [{"title": "\u63a5\u53e3\u4e0e\u80fd\u529b\u8fb9\u754c", "paragraphs": ["\u77e9\u9635\u8bb0\u5f55\u6b64\u6e90\u7801\u6784\u5efa\u5b9e\u9645\u6ce8\u518c\u7684\u56de\u8c03\u3002\u6ce8\u518c\u8868\u660e\u5b9e\u73b0\u4e86\u76f8\u5e94\u63a5\u53e3\u94a9\u5b50\uff1b\u64cd\u4f5c\u662f\u5426\u5141\u8bb8\u8fd8\u53d6\u51b3\u4e8e\u9009\u9879\u3001\u67e5\u8be2\u5f62\u5f0f\u3001\u6743\u9650\u548c\u63d0\u4f9b\u65b9\u89c4\u5219\u3002", "\u4e0b\u65b9\u4fdd\u7559\u540c\u7248\u672c\u5b8c\u6574\u624b\u518c\uff0c\u5305\u62ec\u914d\u7f6e\u3001\u7ea6\u675f\u548c\u793a\u4f8b\u3002\u4e0d\u58f0\u79f0\u5df2\u8fdb\u884c\u8fd0\u884c\u65f6\u80fd\u529b\u6d4b\u8bd5\u3002"]}, {"title": "\u6587\u4ef6\u8bbf\u95ee\u8fb9\u754c", "paragraphs": ["file_fdw \u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 file_fdw \uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 COPY FROM \u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1 COPY \u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002"]}, {"code": "{\n\tFdwRoutine *fdwroutine = makeNode(FdwRoutine);\n\n\tfdwroutine->GetForeignRelSize = fileGetForeignRelSize;\n\tfdwroutine->GetForeignPaths = fileGetForeignPaths;\n\tfdwroutine->GetForeignPlan = fileGetForeignPlan;\n\tfdwroutine->ExplainForeignScan = fileExplainForeignScan;\n\tfdwroutine->BeginForeignScan = fileBeginForeignScan;\n\tfdwroutine->IterateForeignScan = fileIterateForeignScan;\n\tfdwroutine->ReScanForeignScan = fileReScanForeignScan;\n\tfdwroutine->EndForeignScan = fileEndForeignScan;\n\tfdwroutine->AnalyzeForeignTable = fileAnalyzeForeignTable;\n\tfdwroutine->IsForeignScanParallelSafe = fileIsForeignScanParallelSafe;\n\n\tPG_RETURN_POINTER(fdwroutine);\n}", "title": "\u6838\u5fc3\u6e90\u7801\u4e2d\u6ce8\u518c\u7684\u5b9e\u73b0"}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "description": ["\u901a\u8fc7\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u63a5\u53e3\u8bfb\u53d6\u670d\u52a1\u5668\u7aef\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u3002"], "manual_html": "<div class=\"sect1\" id=\"FILE-FDW\">\n<div class=\"titlepage\">\n<div>\n<div>\n<h2 class=\"title\" lang=\"zh\">\n<div>\n<div>\n<h2 class=\"title\" style=\"clear: both\">F.15.\u00a0file_fdw \u2014 \u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6 </h2>\n</div>\n</div>\n</h2>\n</div>\n</div>\n</div>\n<p lang=\"zh\"><code class=\"filename\">file_fdw</code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668 <code class=\"function\">file_fdw</code>\uff0c\u53ef\u7528\u4e8e\u8bbf\u95ee\u670d\u52a1\u5668\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6570\u636e\u6587\u4ef6\uff0c\u6216\u8005\u5728\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7a0b\u5e8f\u5e76\u8bfb\u53d6\u5176\u8f93\u51fa\u3002\u6570\u636e\u6587\u4ef6\u6216\u7a0b\u5e8f\u8f93\u51fa\u5fc5\u987b\u91c7\u7528 <code class=\"command\">COPY FROM</code>\u53ef\u8bfb\u53d6\u7684\u683c\u5f0f\uff1b\u8be6\u89c1<a class=\"xref\" href=\"/docs/18/sql-copy.html\" title=\"COPY\"><span class=\"refentrytitle\">COPY</span></a>\u3002\u5f53\u524d\u5bf9\u6570\u636e\u6587\u4ef6\u7684\u8bbf\u95ee\u4e3a\u53ea\u8bfb\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">filename</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u3002\u76f8\u5bf9\u8def\u5f84\u4ee5\u6570\u636e\u76ee\u5f55\u4e3a\u57fa\u51c6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">filename</code>\u6216<code class=\"literal\">program</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">program</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u6267\u884c\u7684\u547d\u4ee4\u3002\u8be5\u547d\u4ee4\u7684\u6807\u51c6\u8f93\u51fa\u4f1a\u6309\u4f7f\u7528 <code class=\"command\">COPY FROM PROGRAM</code>\u65f6\u7684\u65b9\u5f0f\u8bfb\u53d6\u3002\u5fc5\u987b\u6307\u5b9a<code class=\"literal\">program</code>\u6216<code class=\"literal\">filename</code>\u4e4b\u4e00\uff0c\u4f46\u4e0d\u80fd\u540c\u65f6\u6307\u5b9a\u4e8c\u8005\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">format</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u683c\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">FORMAT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">header</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u662f\u5426\u5305\u542b\u6807\u9898\u884c\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">HEADER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">delimiter</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5b9a\u754c\u7b26\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DELIMITER</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">quote</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u5f15\u7528\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">QUOTE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u8f6c\u4e49</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u8f6c\u4e49\u5b57\u7b26\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ESCAPE</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7684\u7a7a\u503c\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">NULL</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\">\u9ed8\u8ba4</dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8868\u793a\u9ed8\u8ba4\u503c\u7684\u5b57\u7b26\u4e32\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">DEFAULT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">encoding</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u7f16\u7801\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ENCODING</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">on_error</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u9047\u5230\u9519\u8bef\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">ON_ERROR</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">reject_limit</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u5c06\u5217\u8f93\u5165\u503c\u8f6c\u6362\u4e3a\u5176\u6570\u636e\u7c7b\u578b\u65f6\u53ef\u5bb9\u5fcd\u7684\u6700\u5927\u9519\u8bef\u6570\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">REJECT_LIMIT</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">log_verbosity</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"literal\">file_fdw</code>\u53d1\u51fa\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff0c\u4e0e<code class=\"command\">COPY</code>\u7684<code class=\"literal\">LOG_VERBOSITY</code>\u9009\u9879\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u867d\u7136 COPY \u5141\u8bb8 HEADER \u7b49\u9009\u9879\u4e0d\u5e26\u503c\uff0c\u4f46\u5916\u90e8\u8868\u9009\u9879\u8bed\u6cd5\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u90fd\u8981\u6c42\u63d0\u4f9b\u503c\u3002\u8981\u542f\u7528\u901a\u5e38\u4e0d\u5e26\u503c\u4e66\u5199\u7684 COPY \u9009\u9879\uff0c\u53ef\u4ee5\u4f20\u5165 TRUE\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u9009\u9879\u90fd\u662f\u5e03\u5c14\u7c7b\u578b\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u6b64\u5305\u88c5\u5668\u521b\u5efa\u7684\u5916\u90e8\u8868\u7684\u5217\u53ef\u4ee5\u5177\u6709\u4e0b\u5217\u9009\u9879\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">force_not_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u7684\u503c\u4e0d\u5e94\u4e0e\u7a7a\u503c\u4e32\uff08\u5373\u8868\u7ea7\u7684 <code class=\"literal\">null</code>\u9009\u9879\uff09\u5339\u914d\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NOT_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">force_null</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u9009\u9879\u3002\u5982\u679c\u4e3a\u771f\uff0c\u5b83\u6307\u5b9a\u8be5\u5217\u4e2d\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u5373\u4f7f\u5e26\u6709\u5f15\u53f7\uff0c\u4e5f\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u6709\u672a\u52a0\u5f15\u53f7\u4e14\u4e0e\u7a7a\u503c\u4e32\u5339\u914d\u7684\u503c\u624d\u4f1a\u4f5c\u4e3a<code class=\"literal\">NULL</code>\u8fd4\u56de\u3002\u5176\u6548\u679c\u4e0e\u5728<code class=\"command\">COPY</code>\u7684 <code class=\"literal\">FORCE_NULL</code>\u9009\u9879\u4e2d\u5217\u51fa\u8be5\u5217\u76f8\u540c\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">file_fdw \u76ee\u524d\u4e0d\u652f\u6301 COPY \u7684 FORCE_QUOTE \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e9b\u9009\u9879\u53ea\u80fd\u5728\u5916\u90e8\u8868\u6216\u5176\u5217\u4e0a\u6307\u5b9a\uff0c\u4e0d\u80fd\u5728<code class=\"literal\">file_fdw</code>\u5916\u90e8\u6570\u636e\u5305\u88c5\u5668\u7684\u9009\u9879\u4e2d\u6307\u5b9a\uff0c\u4e5f\u4e0d\u80fd\u5728\u4f7f\u7528\u8be5\u5305\u88c5\u5668\u7684\u670d\u52a1\u5668\u6216\u7528\u6237\u6620\u5c04\u7684\u9009\u9879\u4e2d\u6307\u5b9a\u3002</p>\n<p lang=\"zh\">\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u66f4\u6539\u8868\u7ea7\u9009\u9879\u9700\u8981\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u6216\u8005\u62e5\u6709\u89d2\u8272<code class=\"literal\">pg_read_server_files</code>\uff08\u4f7f\u7528\u6587\u4ef6\u540d\u65f6\uff09\u6216\u89d2\u8272<code class=\"literal\">pg_execute_server_program</code>\uff08\u4f7f\u7528\u7a0b\u5e8f\u65f6\uff09\u7684\u6743\u9650\uff1a\u53ea\u6709\u7279\u5b9a\u7528\u6237\u624d\u5e94\u80fd\u591f\u63a7\u5236\u8bfb\u53d6\u54ea\u4e2a\u6587\u4ef6\u6216\u8fd0\u884c\u54ea\u4e2a\u7a0b\u5e8f\u3002\u539f\u5219\u4e0a\u4e5f\u53ef\u4ee5\u5141\u8bb8\u666e\u901a\u7528\u6237\u66f4\u6539\u5176\u4ed6\u9009\u9879\uff0c\u4f46\u76ee\u524d\u5c1a\u4e0d\u652f\u6301\u3002</p>\n<p lang=\"zh\">\u5728\u6307\u5b9a<code class=\"literal\">program</code>\u9009\u9879\u65f6\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8be5\u9009\u9879\u5b57\u7b26\u4e32\u4f1a\u7531 shell \u6267\u884c\u3002\u5982\u679c\u9700\u8981\u5411\u8be5\u547d\u4ee4\u4f20\u9012\u6765\u81ea\u4e0d\u53d7\u4fe1\u4efb\u6765\u6e90\u7684\u53c2\u6570\uff0c\u5fc5\u987b\u8c28\u614e\u53bb\u9664\u6216\u8f6c\u4e49\u4efb\u4f55\u5bf9 shell \u53ef\u80fd\u5177\u6709\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002\u51fa\u4e8e\u5b89\u5168\u539f\u56e0\uff0c\u6700\u597d\u4f7f\u7528\u56fa\u5b9a\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u6216\u8005\u81f3\u5c11\u907f\u514d\u5411\u5176\u4e2d\u4f20\u9012\u4efb\u4f55\u7528\u6237\u8f93\u5165\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u4f7f\u7528<code class=\"literal\">file_fdw</code>\u7684\u5916\u90e8\u8868\uff0c<code class=\"command\">EXPLAIN</code>\u4f1a\u663e\u793a\u5f85\u8bfb\u53d6\u7684\u6587\u4ef6\u540d\u6216\u5f85\u8fd0\u884c\u7684\u7a0b\u5e8f\u540d\u3002\u5bf9\u4e8e\u6587\u4ef6\uff0c\u9664\u975e\u6307\u5b9a<code class=\"literal\">COSTS OFF</code>\uff0c\u5426\u5219\u8fd8\u4f1a\u663e\u793a\u6587\u4ef6\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002</p>\n<div class=\"example\" id=\"id-1.11.7.25.14\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.1.\u00a0\u4e3a PostgreSQL CSV \u65e5\u5fd7\u521b\u5efa\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\"><code class=\"literal\">file_fdw</code>\u7684\u4e00\u4e2a\u660e\u663e\u7528\u9014\uff0c\u662f\u5c06 PostgreSQL \u6d3b\u52a8\u65e5\u5fd7\u4f5c\u4e3a\u8868\u63d0\u4f9b\u4ee5\u4f9b\u67e5\u8be2\u3002\u8981\u505a\u5230\u8fd9\u4e00\u70b9\uff0c\u9996\u5148\u5fc5\u987b<a class=\"link\" href=\"/docs/18/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG\" title=\"19.8.4.\u00a0\u4f7f\u7528 CSV \u683c\u5f0f\u7684\u65e5\u5fd7\u8f93\u51fa\">\u5c06\u65e5\u5fd7\u8bb0\u5f55\u5230 CSV \u6587\u4ef6\u4e2d\uff0c</a>\u8fd9\u91cc\u5c06\u8be5\u6587\u4ef6\u79f0\u4e3a<code class=\"literal\">pglog.csv</code>\u3002\u9996\u5148\uff0c\u5c06<code class=\"literal\">file_fdw</code> \u5b89\u88c5\u4e3a\u6269\u5c55\uff1a</p>\n<pre class=\"programlisting\">CREATE EXTENSION file_fdw;\n</pre>\n<p lang=\"zh\">\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5916\u90e8\u670d\u52a1\u5668\uff1a</p>\n<pre class=\"programlisting\">CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;\n</pre>\n<p lang=\"zh\">\u73b0\u5728\u5c31\u53ef\u4ee5\u521b\u5efa\u5916\u90e8\u8868\u4e86\u3002\u4f7f\u7528<code class=\"command\">CREATE FOREIGN TABLE</code>\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u8be5\u8868\u7684\u5217\u3001CSV \u6587\u4ef6\u540d\u53ca\u5176\u683c\u5f0f\uff1a</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE pglog (\n  log_time timestamp(3) with time zone,\n  user_name text,\n  database_name text,\n  process_id integer,\n  connection_from text,\n  session_id text,\n  session_line_num bigint,\n  command_tag text,\n  session_start_time timestamp with time zone,\n  virtual_transaction_id text,\n  transaction_id bigint,\n  error_severity text,\n  sql_state_code text,\n  message text,\n  detail text,\n  hint text,\n  internal_query text,\n  internal_query_pos integer,\n  context text,\n  query text,\n  query_pos integer,\n  location text,\n  application_name text,\n  backend_type text,\n  leader_pid integer,\n  query_id bigint\n) SERVER pglog\nOPTIONS ( filename 'log/pglog.csv', format 'csv' );\n</pre>\n<p lang=\"zh\">\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86 \u2014 \u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u67e5\u8be2\u65e5\u5fd7\u4e86\u3002\u5f53\u7136\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u8fd8\u9700\u8981\u5b9a\u4e49\u67d0\u79cd\u65b9\u6cd5\u6765\u5904\u7406\u65e5\u5fd7\u8f6e\u8f6c\u3002</p>\n</div>\n</div><br class=\"example-break\"/>\n<div class=\"example\" id=\"id-1.11.7.25.15\">\n<p class=\"title\" lang=\"zh\"><strong>\u4f8b\u00a0F.2.\u00a0\u521b\u5efa\u5177\u6709\u5217\u9009\u9879\u7684\u5916\u90e8\u8868</strong></p>\n<div class=\"example-contents\">\n<p lang=\"zh\">\u8981\u4e3a\u67d0\u4e00\u5217\u8bbe\u7f6e<code class=\"literal\">force_null</code>\u9009\u9879\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">OPTIONS</code>\u5173\u952e\u5b57\u3002</p>\n<pre class=\"programlisting\">CREATE FOREIGN TABLE films (\n code char(5) NOT NULL,\n title text NOT NULL,\n rating text OPTIONS (force_null 'true')\n) SERVER film_server\nOPTIONS ( filename 'films/db.csv', format 'csv' );\n</pre>\n</div>\n</div><br class=\"example-break\"/>\n</div>", "manual_path": "/docs/18/file-fdw.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/catalog-pg-amproc.html", "method": "same-major semantic node", "sha256": "c1b7d16e812991b4d5fb68085a27c8ff82aeaffa34afda56c5837f9b7588187c", "language": "zh", "matched_nodes": ["#CATALOG-PG-AMPROC/p[5]/span[2]/span[0]"]}, {"url": "/docs/18/datatype-binary.html", "method": "same-major semantic node", "sha256": "c920ef4acee3e68440b2da39e5417247a1e7d0251c0bb2bf6c929e0a1e5749fd", "language": "zh", "matched_nodes": ["#DATATYPE-BINARY/p[8]/span[3]/span[0]"]}, {"url": "/docs/18/file-fdw.html", "method": "same-major semantic node", "sha256": "406657f6908f1afd91cef4891e43e779e4d23d4c55e07754cb68dd75cc848a05", "language": "zh", "matched_nodes": ["#FILE-FDW/div[0]", "#FILE-FDW/div[13]/div[1]/p[0]", "#FILE-FDW/div[13]/div[1]/p[2]", "#FILE-FDW/div[13]/div[1]/p[4]", "#FILE-FDW/div[13]/div[1]/p[6]", "#FILE-FDW/div[13]/p[0]", "#FILE-FDW/div[15]/div[1]/p[0]", "#FILE-FDW/div[15]/p[0]", "#FILE-FDW/div[4]/dl[0]/dd[11]", "#FILE-FDW/div[4]/dl[0]/dd[13]", "#FILE-FDW/div[4]/dl[0]/dd[15]", "#FILE-FDW/div[4]/dl[0]/dd[17]", "#FILE-FDW/div[4]/dl[0]/dd[19]", "#FILE-FDW/div[4]/dl[0]/dd[1]", "#FILE-FDW/div[4]/dl[0]/dd[21]", "#FILE-FDW/div[4]/dl[0]/dd[23]", "#FILE-FDW/div[4]/dl[0]/dd[25]", "#FILE-FDW/div[4]/dl[0]/dd[3]", "#FILE-FDW/div[4]/dl[0]/dd[5]", "#FILE-FDW/div[4]/dl[0]/dd[7]", "#FILE-FDW/div[4]/dl[0]/dd[9]", "#FILE-FDW/div[7]/dl[0]/dd[1]", "#FILE-FDW/div[7]/dl[0]/dd[3]", "#FILE-FDW/p[10]", "#FILE-FDW/p[11]", "#FILE-FDW/p[12]", "#FILE-FDW/p[2]", "#FILE-FDW/p[3]", "#FILE-FDW/p[6]", "#FILE-FDW/p[9]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "Reads server-side files or program output through the foreign-data wrapper interface.", "/versions/18/facts/0/label": "Interface family", "/versions/18/facts/0/value": "Foreign-data wrapper", "/versions/18/facts/1/label": "Handler or routine", "/versions/18/facts/2/label": "Recorded callbacks", "/versions/18/tables/0/title": "Registered interface handlers", "/versions/18/tables/1/title": "Documented options", "/versions/18/related/0/label": "Foreign-data wrapper catalog", "/versions/18/related/1/label": "Existing extension catalogue identity", "/versions/18/related/2/label": "Foreign Scan plan node", "/versions/18/sections/0/title": "Interface and capability boundaries", "/versions/18/sections/1/title": "File access boundary", "/versions/18/sections/2/title": "Registered implementation in core source", "/versions/18/tables/1/rows/6/name": "escape", "/versions/18/tables/1/rows/8/name": "default", "/versions/18/tables/0/rows/0/state": "Handler registered; conditions apply", "/versions/18/tables/0/rows/1/state": "No handler registered in this build", "/versions/18/tables/0/rows/2/state": "No handler registered in this build", "/versions/18/tables/0/rows/3/state": "No handler registered in this build", "/versions/18/tables/0/rows/4/state": "No handler registered in this build", "/versions/18/tables/0/rows/5/state": "No handler registered in this build", "/versions/18/tables/0/rows/6/state": "No handler registered in this build", "/versions/18/tables/0/rows/7/state": "No handler registered in this build", "/versions/18/tables/0/rows/8/state": "No handler registered in this build", "/versions/18/tables/0/rows/9/state": "No handler registered in this build", "/versions/18/sections/0/paragraphs/0": "The matrix records callbacks actually registered in this source build. Registration identifies an implemented interface hook; options, query shape, privileges and provider rules determine whether an operation is allowed.", "/versions/18/sections/0/paragraphs/1": "The complete same-version manual below retains configuration, constraints and examples. No runtime capability test is claimed.", "/versions/18/sections/1/paragraphs/0": "The file_fdw module provides the foreign-data wrapper file_fdw , which can be used to access data files in the server's file system, or to execute programs on the server and read their output. The data file or program output must be in a format that can be read by COPY FROM ; see COPY for details. Access to data files is currently read-only.", "/versions/18/tables/0/rows/0/feature": "Scan rows", "/versions/18/tables/0/rows/5/feature": "Join path pushdown", "/versions/18/tables/0/rows/6/feature": "Upper paths, including aggregation", "/versions/18/tables/0/rows/7/feature": "Batch insert", "/versions/18/tables/0/rows/8/feature": "Asynchronous append execution", "/versions/18/tables/0/rows/9/feature": "Import schema", "/versions/18/tables/0/columns/0/label": "Interface operation", "/versions/18/tables/0/columns/1/label": "Source observation", "/versions/18/tables/0/columns/2/label": "Callback", "/versions/18/tables/0/columns/3/label": "Implementation", "/versions/18/tables/1/columns/0/label": "Option", "/versions/18/tables/1/columns/1/label": "Same-version definition", "/versions/18/tables/1/rows/0/definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both.", "/versions/18/tables/1/rows/1/definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both.", "/versions/18/tables/1/rows/2/definition": "Specifies the data format, the same as COPY 's FORMAT option.", "/versions/18/tables/1/rows/3/definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option.", "/versions/18/tables/1/rows/4/definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option.", "/versions/18/tables/1/rows/5/definition": "Specifies the data quote character, the same as COPY 's QUOTE option.", "/versions/18/tables/1/rows/6/definition": "Specifies the data escape character, the same as COPY 's ESCAPE option.", "/versions/18/tables/1/rows/7/definition": "Specifies the data null string, the same as COPY 's NULL option.", "/versions/18/tables/1/rows/8/definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option.", "/versions/18/tables/1/rows/9/definition": "Specifies the data encoding, the same as COPY 's ENCODING option.", "/versions/18/tables/1/rows/10/definition": "Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option.", "/versions/18/tables/1/rows/11/definition": "Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option.", "/versions/18/tables/1/rows/12/definition": "Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option.", "/versions/18/tables/1/rows/13/definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.", "/versions/18/tables/1/rows/14/definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option.", "/versions/18/tables/0/rows/1/implementation": "Not registered", "/versions/18/tables/0/rows/2/implementation": "Not registered", "/versions/18/tables/0/rows/3/implementation": "Not registered", "/versions/18/tables/0/rows/4/implementation": "Not registered", "/versions/18/tables/0/rows/5/implementation": "Not registered", "/versions/18/tables/0/rows/6/implementation": "Not registered", "/versions/18/tables/0/rows/7/implementation": "Not registered", "/versions/18/tables/0/rows/8/implementation": "Not registered", "/versions/18/tables/0/rows/9/implementation": "Not registered"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "5783145c5846ef9c1ce0e5cd3f344d1f62fe65c127a7eb9502b49ad3fe90fc19"}, "evidence_kind": "source and documentation", "comparison_data": {"options": [{"name": "filename", "definition": "Specifies the file to be read. Relative paths are relative to the data directory. Either filename or program must be specified, but not both."}, {"name": "program", "definition": "Specifies the command to be executed. The standard output of this command will be read as though COPY FROM PROGRAM were used. Either program or filename must be specified, but not both."}, {"name": "format", "definition": "Specifies the data format, the same as COPY 's FORMAT option."}, {"name": "header", "definition": "Specifies whether the data has a header line, the same as COPY 's HEADER option."}, {"name": "delimiter", "definition": "Specifies the data delimiter character, the same as COPY 's DELIMITER option."}, {"name": "quote", "definition": "Specifies the data quote character, the same as COPY 's QUOTE option."}, {"name": "escape", "definition": "Specifies the data escape character, the same as COPY 's ESCAPE option."}, {"name": "null", "definition": "Specifies the data null string, the same as COPY 's NULL option."}, {"name": "default", "definition": "Specifies the string that represents a default value, the same as COPY 's DEFAULT option."}, {"name": "encoding", "definition": "Specifies the data encoding, the same as COPY 's ENCODING option."}, {"name": "on_error", "definition": "Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option."}, {"name": "reject_limit", "definition": "Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option."}, {"name": "log_verbosity", "definition": "Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option."}, {"name": "force_not_null", "definition": "This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option."}, {"name": "force_null", "definition": "This is a Boolean option. If true, it specifies that values of the column which match the null string are returned as NULL even if the value is quoted. Without this option, only unquoted values matching the null string are returned as NULL . This has the same effect as listing the column in COPY 's FORCE_NULL option."}], "callbacks": {"EndForeignScan": "fileEndForeignScan", "GetForeignPlan": "fileGetForeignPlan", "GetForeignPaths": "fileGetForeignPaths", "BeginForeignScan": "fileBeginForeignScan", "GetForeignRelSize": "fileGetForeignRelSize", "ReScanForeignScan": "fileReScanForeignScan", "ExplainForeignScan": "fileExplainForeignScan", "IterateForeignScan": "fileIterateForeignScan", "AnalyzeForeignTable": "fileAnalyzeForeignTable", "IsForeignScanParallelSafe": "fileIsForeignScanParallelSafe"}, "source_options": [], "protocol_versions": {}}, "comparison_hash": "3a50d8e658a12e9ec3405a8fd6dae6ec70a2fe3837297394492fb97a95b01306", "manual_language": "zh", "runtime_verified": false}, "comparison": {"left": "17", "right": "18", "status": "changed", "diff": "--- PostgreSQL 17\n+++ PostgreSQL 18\n@@ -53,6 +53,18 @@\n       \"name\": \"encoding\"\n     },\n     {\n+      \"definition\": \"Specifies how to behave when encountering an error converting a column's input value into its data type, the same as COPY 's ON_ERROR option.\",\n+      \"name\": \"on_error\"\n+    },\n+    {\n+      \"definition\": \"Specifies the maximum number of errors tolerated while converting a column's input value to its data type, the same as COPY 's REJECT_LIMIT option.\",\n+      \"name\": \"reject_limit\"\n+    },\n+    {\n+      \"definition\": \"Specifies the amount of messages emitted by file_fdw , the same as COPY 's LOG_VERBOSITY option.\",\n+      \"name\": \"log_verbosity\"\n+    },\n+    {\n       \"definition\": \"This is a Boolean option. If true, it specifies that values of the column should not be matched against the null string (that is, the table-level null option). This has the same effect as listing the column in COPY 's FORCE_NOT_NULL option.\",\n       \"name\": \"force_not_null\"\n     },"}}