{"kind": "tool", "major": "18", "item": {"slug": "pg-dump", "name": "pg_dump", "name_zh": "", "category": "\u5ba2\u6237\u7aef\u7a0b\u5e8f", "summary": "pg_dump \u2014 \u5c06 PostgreSQL \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f", "aliases": ["pg_dump"], "content_hash": "99ec8b01a19bc0f6279c131a9c8ec9b411abde289dcab566600345c8e1b22b1a", "versions": {"10": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "10.23"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "52"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u6216 --schema-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-b --blobs"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-B --no-blobs"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u6e05\u7406\uff08\u5220\u9664\uff09\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\uff08\u9664\u975e\u540c\u65f6\u6307\u5b9a --if-exists \uff0c\u5426\u5219\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u4e0d\u5b58\u5728\u67d0\u4e9b\u5bf9\u8c61\uff0c\u6062\u590d\u65f6\u53ef\u80fd\u4f1a\u4ea7\u751f\u4e00\u4e9b\u65e0\u5bb3\u7684\u9519\u8bef\u6d88\u606f\u3002\uff09", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d schema \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 schema \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-n schema --schema= schema"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u540d\u79f0\u5339\u914d schema \u7684\u6a21\u5f0f\u3002\u8be5\u5339\u914d\u6761\u4ef6\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a -N \uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6761\u4ef6\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-N schema --exclude-schema= schema"}}, {"summary": "\u5c06\u5bf9\u8c61\u6807\u8bc6\u7b26\uff08 OID \uff09\u4f5c\u4e3a\u6bcf\u4e2a\u8868\u7684\u6570\u636e\u7684\u4e00\u90e8\u5206\u8fdb\u884c\u8f6c\u50a8\u3002\u5982\u679c\u5e94\u7528\u7a0b\u5e8f\u4ee5\u67d0\u79cd\u65b9\u5f0f\u5f15\u7528 OID \u5217\uff08\u4f8b\u5982\u5728\u5916\u952e\u7ea6\u675f\u4e2d\uff09\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002\u5426\u5219\uff0c\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-o --oids"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d table \u7684\u8868\u3002\u8fd9\u91cc\uff0c \u201c \u8868 \u201d \u5305\u62ec\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5e8f\u5217\u548c\u5916\u90e8\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 table \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-t table --table= table"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d table \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-T table --exclude-table= table"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9 gzip \u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-Z 0..9 --compress= 0..9"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4 ( INSERT INTO table ( column , ...) VALUES ... )\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u6b64\u9009\u9879\u4e3a\u6bcf\u4e00\u884c\u751f\u6210\u5355\u72ec\u7684\u547d\u4ee4\uff0c\u91cd\u65b0\u88c5\u8f7d\u67d0\u4e00\u884c\u65f6\u51fa\u9519\u53ea\u4f1a\u5bfc\u81f4\u8be5\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d table \u6a21\u5f0f\u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a --exclude-table-data \uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u8868\u7684\u5b9a\u4e49\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u7684\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--exclude-table-data= table"}}, {"summary": "\u6e05\u7406\u6570\u636e\u5e93\u5bf9\u8c61\u65f6\u4f7f\u7528\u6761\u4ef6\u547d\u4ee4\uff08\u5373\u6dfb\u52a0 IF EXISTS \u5b50\u53e5\uff09\u3002\u53ea\u6709\u540c\u65f6\u6307\u5b9a --clean \uff0c\u6b64\u9009\u9879\u624d\u6709\u6548\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u8f7d\u5230\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u6b64\u9009\u9879\u4e3a\u6bcf\u4e00\u884c\u751f\u6210\u5355\u72ec\u7684\u547d\u4ee4\uff0c\u91cd\u65b0\u88c5\u8f7d\u67d0\u4e00\u884c\u65f6\u51fa\u9519\u53ea\u4f1a\u5bfc\u81f4\u8be5\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u6392\u5217\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5b8c\u5168\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u4e0d\u53d7\u5217\u987a\u5e8f\u53d8\u5316\u5f71\u54cd\uff0c\u4f46\u4f1a\u66f4\u6162\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605 -j \u53c2\u6570\u7684\u6587\u6863\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--no-synchronized-snapshots"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.82 \uff09\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u9650\u5b9a\u6761\u4ef6\u81f3\u5c11\u5339\u914d\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5f0f\u6216\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6a21\u5f0f\u548c\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c pg_dump \u5373\u4f7f\u6ca1\u6709\u4f7f\u7528 --strict-names \u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u7ecf\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/10/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/10/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "signature": "-b --blobs", "source_url": "/docs/10/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-blobs", "source_url": "/docs/10/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to clean (drop) database objects prior to outputting the commands for creating them. (Unless --if-exists is also specified, restore might generate some harmless error messages, if any objects were not present in the destination database.)", "signature": "-c --clean", "source_url": "/docs/10/app-pgdump.html", "description": "Output commands to clean (drop) database objects prior to outputting the commands for creating them. (Unless --if-exists is also specified, restore might generate some harmless error messages, if any objects were not present in the destination database.) This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/10/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/10/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/10/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/10/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/10/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump master process requests shared locks on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the master process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the master process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the master connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n schema", "--schema= schema"], "summary": "Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "signature": "-n schema --schema= schema", "source_url": "/docs/10/app-pgdump.html", "description": "Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N schema", "--exclude-schema= schema"], "summary": "Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N schema --exclude-schema= schema", "source_url": "/docs/10/app-pgdump.html", "description": "Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-o", "--oids"], "summary": "Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used.", "signature": "-o --oids", "source_url": "/docs/10/app-pgdump.html", "description": "Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/10/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/10/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data.", "signature": "-s --schema-only", "source_url": "/docs/10/app-pgdump.html", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/10/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t table", "--table= table"], "summary": "Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "signature": "-t table --table= table", "source_url": "/docs/10/app-pgdump.html", "description": "Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab ."}, {"names": ["-T table", "--exclude-table= table"], "summary": "Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T table --exclude-table= table", "source_url": "/docs/10/app-pgdump.html", "description": "Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.", "signature": "-v --verbose", "source_url": "/docs/10/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/10/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/10/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "signature": "-Z 0..9 --compress= 0..9", "source_url": "/docs/10/app-pgdump.html", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/10/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in reloading a row causes only that row to be lost rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/10/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in reloading a row causes only that row to be lost rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/10/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is reloaded. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data reload.", "signature": "--disable-triggers", "source_url": "/docs/10/app-pgdump.html", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is reloaded. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data reload. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/10/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= table"], "summary": "Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= table", "source_url": "/docs/10/app-pgdump.html", "description": "Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--if-exists"], "summary": "Use conditional commands (i.e., add an IF EXISTS clause) when cleaning database objects. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/10/app-pgdump.html", "description": "Use conditional commands (i.e., add an IF EXISTS clause) when cleaning database objects. This option is not valid unless --clean is also specified."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in reloading a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/10/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in reloading a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/10/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/10/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/10/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/10/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/10/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "signature": "--no-synchronized-snapshots", "source_url": "/docs/10/app-pgdump.html", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/10/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/10/app-pgdump.html", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/10/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/10/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/10/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/10/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 48 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "summary": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/10/app-pgdump.html", "description": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/10/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/10/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/10/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/10/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/10/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/10/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/10/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/10/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/10/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=10", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.bz2", "label": "10.23", "major": "10", "channel": "historical", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/10/postgresql-10-A4.pdf", "bytes": 12631706, "pages": 2591, "sha256": "34497ab9efb45c5bdf1bd11b9016b5451354feb462fa029cf74557a5fa5fbbc1", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/10/postgresql-10-US.pdf", "bytes": 12531684, "pages": 2724, "sha256": "429cc7133ddf4f97c560aa466dc9caea4b718721a8321e293357037cf0af4733", "built_at": "2026-09-26"}}, "tree": "10", "index": "index.html", "major": "10", "pages": 1085, "release": "10.23", "source_url": "https://ftp.postgresql.org/pub/source/v10.23/postgresql-10.23.tar.bz2", "svg_assets": 0, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "94a4b2528372458e5662c18d406629266667c437198160a18cdfd2c4a4d6eee9"}, "revision": "f9301feba91e2e2566038a36b8cee0e4402db68989538f88670fddd20b1f78ea", "evidence_kind": "English manual and source declarations", "source_sha256": "94a4b2528372458e5662c18d406629266667c437198160a18cdfd2c4a4d6eee9"}, "sources": [{"url": "https://pg.center/docs/10/app-pgdump.html", "file": "app-pgdump.html", "label": "10.23 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "fa478b210ceee675ec1a08a237e597d597b72b8dfde9dfe4e612005c333e6a9a", "language": "en", "original_url": "/docs/10/app-pgdump.html"}, {"url": "https://pg.center/docs/10/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "e4330732b6acd6c025a1fbdce45574b23d964de847a1b849ea88b98ab628d2e2", "language": "en", "original_url": "/docs/10/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06\u4e00\u4e2a PostgreSQL \u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\">pg_dump</span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06\u4e00\u4e2a<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.12.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u662f\u4e00\u4e2a\u7528\u4e8e\u5907\u4efd<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5907\u4efd\u3002<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5907\u4efd\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u4f8b\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/10/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/10/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/10/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\">pg_restore</span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5907\u4efd\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86<code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u6216<code class=\"option\">--schema-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code>\u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u6e05\u7406\uff08\u5220\u9664\uff09\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\uff08\u9664\u975e\u540c\u65f6\u6307\u5b9a<code class=\"option\">--if-exists</code>\uff0c\u5426\u5219\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u4e0d\u5b58\u5728\u67d0\u4e9b\u5bf9\u8c61\uff0c\u6062\u590d\u65f6\u53ef\u80fd\u4f1a\u4ea7\u751f\u4e00\u4e9b\u65e0\u5bb3\u7684\u9519\u8bef\u6d88\u606f\u3002\uff09</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/10/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u4e3b\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u4e3b\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u83b7\u5f97\u4e00\u81f4\u7684\u5907\u4efd\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u4e3b\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u8981\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u5fc5\u987b\u786e\u4fdd\u4ece\u4e3b\u63a7\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u5230\u6700\u540e\u4e00\u4e2a\u5de5\u4f5c\u4efb\u52a1\u8fde\u63a5\u6570\u636e\u5e93\u8fd9\u6bb5\u65f6\u95f4\u5185\uff0c\u6570\u636e\u5e93\u5185\u5bb9\u4e0d\u53d1\u751f\u53d8\u5316\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u5728\u5f00\u59cb\u5907\u4efd\u4e4b\u524d\uff0c\u505c\u6b62\u6240\u6709\u8bbf\u95ee\u8be5\u6570\u636e\u5e93\u5e76\u4fee\u6539\u6570\u636e\u7684\u8fdb\u7a0b\uff08DDL \u548c DML\uff09\u3002\u5bf9 9.2 \u4e4b\u524d\u7684 PostgreSQL \u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \u65f6\uff0c\u8fd8\u5fc5\u987b\u6307\u5b9a --no-synchronized-snapshots \u53c2\u6570\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>schema</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>schema</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>schema</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/10/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/10/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--blobs</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>schema</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u540d\u79f0\u5339\u914d<em class=\"replaceable\"><code>schema</code></em>\u7684\u6a21\u5f0f\u3002\u8be5\u5339\u914d\u6761\u4ef6\u6309\u7167\u4e0e<code class=\"option\">-n</code>\u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a<code class=\"option\">-N</code>\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6761\u4ef6\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o</code><br/></span><span class=\"term\"><code class=\"option\">--oids</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5c06\u5bf9\u8c61\u6807\u8bc6\u7b26\uff08OID\uff09\u4f5c\u4e3a\u6bcf\u4e2a\u8868\u7684\u6570\u636e\u7684\u4e00\u90e8\u5206\u8fdb\u884c\u8f6c\u50a8\u3002\u5982\u679c\u5e94\u7528\u4ee5\u67d0\u79cd\u65b9\u5f0f\u5f15\u7528\u4e86 OID \u5217\uff08\u4f8b\u5982\u5916\u952e\u7ea6\u675f\uff09\uff0c\u5e94\u4f7f\u7528\u6b64\u9009\u9879\uff1b\u5426\u5219\u4e0d\u5e94\u4f7f\u7528\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0e<code class=\"option\">--data-only</code>\u7684\u4f5c\u7528\u76f8\u53cd\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a<code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u7531\u4e8e\u5386\u53f2\u539f\u56e0\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>table</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>table</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>table</code></em> \u7684\u8868\u3002\u8fd9\u91cc\uff0c<span class=\"quote\">\u201c<span class=\"quote\">\u8868</span>\u201d</span>\u5305\u62ec\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5e8f\u5217\u548c\u5916\u90e8\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>table</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/10/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/10/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\"><code class=\"option\">-t</code>\u5f00\u5173\u7684\u884c\u4e3a\u4e0e 8.2 \u4e4b\u524d\u7684<span class=\"productname\">PostgreSQL</span>\u7248\u672c\u5e76\u4e0d\u5b8c\u5168\u5411\u4e0a\u517c\u5bb9\u3002\u4ee5\u524d\uff0c\u5199\u6210<code class=\"literal\">-t tab</code>\u4f1a\u8f6c\u50a8\u6240\u6709\u540d\u4e3a<code class=\"literal\">tab</code>\u7684\u8868\uff0c\u73b0\u5728\u5219\u53ea\u8f6c\u50a8\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84\u4e2d\u53ef\u89c1\u7684\u90a3\u4e2a\u8868\u3002\u8981\u83b7\u5f97\u65e7\u884c\u4e3a\uff0c\u53ef\u4ee5\u5199\u6210<code class=\"literal\">-t '*.tab'</code>\u3002\u6b64\u5916\uff0c\u8981\u9009\u62e9\u7279\u5b9a\u6a21\u5f0f\u4e2d\u7684\u8868\uff0c\u5fc5\u987b\u5199\u6210\u7c7b\u4f3c<code class=\"literal\">-t sch.tab</code>\u7684\u5f62\u5f0f\uff0c\u800c\u4e0d\u662f\u65e7\u7684<code class=\"literal\">-n sch -t tab</code>\u5199\u6cd5\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>table</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>table</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>table</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>0..9</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>0..9</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9<span class=\"application\">gzip</span>\u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4 (<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>)\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u6b64\u9009\u9879\u4e3a\u6bcf\u4e00\u884c\u751f\u6210\u5355\u72ec\u7684\u547d\u4ee4\uff0c\u91cd\u65b0\u88c5\u8f7d\u67d0\u4e00\u884c\u65f6\u51fa\u9519\u53ea\u4f1a\u5bfc\u81f4\u8be5\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/10/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/10/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>table</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d<em class=\"replaceable\"><code>table</code></em>\u6a21\u5f0f\u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e<code class=\"option\">-t</code>\u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a<code class=\"option\">--exclude-table-data</code>\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u8868\u7684\u5b9a\u4e49\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u7684\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u9605<code class=\"option\">--schema-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6e05\u7406\u6570\u636e\u5e93\u5bf9\u8c61\u65f6\u4f7f\u7528\u6761\u4ef6\u547d\u4ee4\uff08\u5373\u6dfb\u52a0<code class=\"literal\">IF EXISTS</code>\u5b50\u53e5\uff09\u3002\u53ea\u6709\u540c\u65f6\u6307\u5b9a<code class=\"option\">--clean</code>\uff0c\u6b64\u9009\u9879\u624d\u6709\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08\u800c\u4e0d\u662f<code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u8f7d\u5230\u975e<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u6b64\u9009\u9879\u4e3a\u6bcf\u4e00\u884c\u751f\u6210\u5355\u72ec\u7684\u547d\u4ee4\uff0c\u91cd\u65b0\u88c5\u8f7d\u67d0\u4e00\u884c\u65f6\u51fa\u9519\u53ea\u4f1a\u5bfc\u81f4\u8be5\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u6392\u5217\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5b8c\u5168\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code>\u9009\u9879\u4e0d\u53d7\u5217\u987a\u5e8f\u53d8\u5316\u5f71\u54cd\uff0c\u4f46\u4f1a\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-synchronized-snapshots</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c<code class=\"command\">pg_dump -j</code>\uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605<code class=\"option\">-j</code>\u53c2\u6570\u7684\u6587\u6863\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">data \u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u548c\u5e8f\u5217\u503c\u3002post-data \u90e8\u5206\u5305\u542b\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u542b\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/10/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/10/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.82.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.82</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/10/logicaldecoding.html\" title=\"\u7b2c\u00a048\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a048\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u9650\u5b9a\u6761\u4ef6\u81f3\u5c11\u5339\u914d\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5f0f\u6216\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6a21\u5f0f\u548c\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c<span class=\"application\">pg_dump</span>\u5373\u4f7f\u6ca1\u6709\u4f7f\u7528<code class=\"option\">--strict-names</code>\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u5f71\u54cd<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code>\u6216<code class=\"option\">--exclude-table-data</code>\u3002\u6392\u9664\u6a21\u5f0f\u672a\u5339\u914d\u5230\u4efb\u4f55\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/10/libpq.html#LIBPQ-CONNSTRING\" title=\"33.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u7ecf\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.12.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u548c\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u8fd9\u4e2a\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/10/libpq-envars.html\" title=\"33.14.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a033.14\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/10/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7edf\u8ba1\u6536\u96c6\u5668\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u610f</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4ec5\u6570\u636e\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e0d\u5305\u542b\u4f18\u5316\u5668\u7528\u4e8e\u51b3\u5b9a\u67e5\u8be2\u8ba1\u5212\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\uff0c\u6700\u597d\u8fd0\u884c<code class=\"command\">ANALYZE</code>\u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff1b\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/10/maintenance.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/10/maintenance.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002\u8f6c\u50a8\u6587\u4ef6\u4e5f\u4e0d\u5305\u542b\u4efb\u4f55<code class=\"command\">ALTER DATABASE ... SET</code>\u547d\u4ee4\uff1b\u8fd9\u4e9b\u8bbe\u7f6e\u7531<a class=\"xref\" href=\"/docs/10/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u4e0e\u6570\u636e\u5e93\u7528\u6237\u53ca\u5176\u4ed6\u6574\u4e2a\u5b89\u88c5\u73af\u5883\u7684\u8bbe\u7f6e\u4e00\u8d77\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 8.0 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u5c06\u540d\u4e3a <code class=\"literal\">mydb</code> \u7684\u6570\u636e\u5e93\u8f6c\u50a8\u5230 SQL \u811a\u672c\u6587\u4ef6\u4e2d\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u5c06\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u8f7d\u5230\u4e00\u4e2a\u65b0\u521b\u5efa\u7684\u6570\u636e\u5e93\u4e2d\uff0c\u5176\u540d\u79f0\u4e3a <code class=\"literal\">newdb</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\u6307\u5b9a\u5927\u5199\u6216\u5927\u5c0f\u5199\u6df7\u5408\u7684\u540d\u79f0\uff0c\u5fc5\u987b\u7528\u53cc\u5f15\u53f7\u62ec\u8d77\u8be5\u540d\u79f0\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u4e3a\u5c0f\u5199\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/10/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6709\u7279\u6b8a\u610f\u4e49\uff0c\u56e0\u6b64\u8fd8\u5fc5\u987b\u7528\u5f15\u53f7\u4fdd\u62a4\u8fd9\u4e9b\u53cc\u5f15\u53f7\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u79f0\u5927\u5c0f\u5199\u6df7\u5408\u7684\u8868\uff0c\u9700\u8981\u5199\u6210\u7c7b\u4f3c\u5982\u4e0b\u7684\u5f62\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre></div>\n<div class=\"refsect1\" id=\"id-1.9.4.12.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/10/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/10/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\">pg_restore</span></a>, <a class=\"xref\" href=\"https://pg.center/docs/10/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span></div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/10/app-pgdump.html", "method": "same-major semantic node", "sha256": "126aa781d25587330615d41139561ada421fe18411b5fe946b60ebc3ca780fa1", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[1]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[17]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/10/description/0": "pg_dump \u2014 extract a PostgreSQL database into a script file or other archive file", "/versions/10/facts/0/label": "Documented executable", "/versions/10/facts/1/label": "Executable version", "/versions/10/facts/2/label": "Reference inventory", "/versions/10/facts/2/value": "Client applications", "/versions/10/facts/3/label": "Option definition groups", "/versions/10/tables/0/title": "Documented options", "/versions/10/tables/1/title": "Environment variables", "/versions/10/related/0/label": "libpq connection parameters", "/versions/10/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "/versions/10/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "/versions/10/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/10/tables/0/rows/3/summary": "Output commands to clean (drop) database objects prior to outputting the commands for creating them. (Unless --if-exists is also specified, restore might generate some harmless error messages, if any objects were not present in the destination database.)", "/versions/10/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/10/tables/0/rows/5/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)", "/versions/10/tables/0/rows/6/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/10/tables/0/rows/7/summary": "Selects the format of the output. format can be one of the following:", "/versions/10/tables/0/rows/8/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/10/tables/0/rows/9/summary": "Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "/versions/10/tables/0/columns/0/label": "Option and arguments", "/versions/10/tables/0/columns/1/label": "Description", "/versions/10/tables/0/rows/10/summary": "Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/10/tables/0/rows/11/summary": "Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used.", "/versions/10/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/10/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/10/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data.", "/versions/10/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/10/tables/0/rows/16/summary": "Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "/versions/10/tables/0/rows/17/summary": "Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/10/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.", "/versions/10/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/10/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/10/tables/0/rows/21/summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "/versions/10/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/10/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in reloading a row causes only that row to be lost rather than the entire table contents.", "/versions/10/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/10/tables/0/rows/25/summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is reloaded. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data reload.", "/versions/10/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/10/tables/0/rows/27/summary": "Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/10/tables/0/rows/28/summary": "Use conditional commands (i.e., add an IF EXISTS clause) when cleaning database objects. This option is not valid unless --clean is also specified.", "/versions/10/tables/0/rows/29/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in reloading a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/10/tables/0/rows/30/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/10/tables/0/rows/31/summary": "Do not dump publications.", "/versions/10/tables/0/rows/32/summary": "Do not dump security labels.", "/versions/10/tables/0/rows/33/summary": "Do not dump subscriptions.", "/versions/10/tables/0/rows/34/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/10/tables/0/rows/35/summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "/versions/10/tables/0/rows/36/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/10/tables/0/rows/37/summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "/versions/10/tables/0/rows/38/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/10/tables/0/rows/39/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/10/tables/0/rows/40/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/10/tables/0/rows/41/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details).", "/versions/10/tables/0/rows/42/summary": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "/versions/10/tables/0/rows/43/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/10/tables/0/rows/44/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/10/tables/0/rows/45/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/10/tables/0/rows/46/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/10/tables/0/rows/47/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/10/tables/0/rows/48/summary": "User name to connect as.", "/versions/10/tables/0/rows/49/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/10/tables/0/rows/50/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/10/tables/0/rows/51/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/10/tables/1/columns/0/label": "Variable", "/versions/10/tables/1/columns/1/label": "Meaning", "/versions/10/tables/1/rows/0/description": "Default connection parameters."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "4a51a69a16052469ef0230fb6e4b542defb96558483083f5a62775d9d5e87302"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "signature": "-b --blobs", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "signature": "-B --no-blobs", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to clean (drop) database objects prior to outputting the commands for creating them. (Unless --if-exists is also specified, restore might generate some harmless error messages, if any objects were not present in the destination database.) This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump master process requests shared locks on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the master process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the master process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the master connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n schema", "--schema= schema"], "signature": "-n schema --schema= schema", "description": "Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N schema", "--exclude-schema= schema"], "signature": "-N schema --exclude-schema= schema", "description": "Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-o", "--oids"], "signature": "-o --oids", "description": "Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t table", "--table= table"], "signature": "-t table --table= table", "description": "Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab ."}, {"names": ["-T table", "--exclude-table= table"], "signature": "-T table --exclude-table= table", "description": "Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "signature": "-Z 0..9 --compress= 0..9", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in reloading a row causes only that row to be lost rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is reloaded. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data reload. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= table"], "signature": "--exclude-table-data= table", "description": "Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use conditional commands (i.e., add an IF EXISTS clause) when cleaning database objects. This option is not valid unless --clean is also specified."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in reloading a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "signature": "--no-synchronized-snapshots", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 48 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}]}, "comparison_hash": "d4971e4d5e4a2373701d1ca29b9fb89686a74e843d410aaf8efced28fda2ec30", "manual_language": "zh"}, "11": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "11.22"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "54"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u6216 --schema-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-b --blobs"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-B --no-blobs"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d schema \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 schema \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-n schema --schema= schema"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u540d\u79f0\u5339\u914d schema \u7684\u6a21\u5f0f\u3002\u8be5\u5339\u914d\u6761\u4ef6\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a -N \uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6761\u4ef6\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-N schema --exclude-schema= schema"}}, {"summary": "\u5c06\u5bf9\u8c61\u6807\u8bc6\u7b26\uff08 OID \uff09\u4f5c\u4e3a\u6bcf\u4e2a\u8868\u7684\u6570\u636e\u7684\u4e00\u90e8\u5206\u8fdb\u884c\u8f6c\u50a8\u3002\u5982\u679c\u5e94\u7528\u7a0b\u5e8f\u4ee5\u67d0\u79cd\u65b9\u5f0f\u5f15\u7528 OID \u5217\uff08\u4f8b\u5982\u5728\u5916\u952e\u7ea6\u675f\u4e2d\uff09\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002\u5426\u5219\uff0c\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-o --oids"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d table \u7684\u8868\u3002\u8fd9\u91cc\uff0c \u201c \u8868 \u201d \u5305\u62ec\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5e8f\u5217\u548c\u5916\u90e8\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 table \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-t table --table= table"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d table \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-T table --exclude-table= table"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9 gzip \u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-Z 0..9 --compress= 0..9"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4 ( INSERT INTO table ( column , ...) VALUES ... )\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u6b64\u9009\u9879\u4e3a\u6bcf\u4e00\u884c\u751f\u6210\u5355\u72ec\u7684\u547d\u4ee4\uff0c\u6062\u590d\u67d0\u4e00\u884c\u65f6\u51fa\u9519\u53ea\u4f1a\u5bfc\u81f4\u8be5\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d table \u6a21\u5f0f\u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a --exclude-table-data \uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u8868\u7684\u5b9a\u4e49\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u7684\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--exclude-table-data= table"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u8f7d\u5230\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u6b64\u9009\u9879\u4e3a\u6bcf\u4e00\u884c\u751f\u6210\u5355\u72ec\u7684\u547d\u4ee4\uff0c\u6062\u590d\u67d0\u4e00\u884c\u65f6\u51fa\u9519\u53ea\u4f1a\u5bfc\u81f4\u8be5\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u6392\u5217\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5b8c\u5168\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u4e0d\u53d7\u5217\u987a\u5e8f\u53d8\u5316\u5f71\u54cd\uff0c\u4f46\u4f1a\u66f4\u6162\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605 -j \u53c2\u6570\u7684\u6587\u6863\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--no-synchronized-snapshots"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.82 \uff09\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u9650\u5b9a\u6761\u4ef6\u81f3\u5c11\u5339\u914d\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5f0f\u6216\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6a21\u5f0f\u548c\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c pg_dump \u5373\u4f7f\u6ca1\u6709\u4f7f\u7528 --strict-names \u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u7ecf\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/11/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/11/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "signature": "-b --blobs", "source_url": "/docs/11/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-blobs", "source_url": "/docs/11/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/11/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/11/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/11/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/11/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/11/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/11/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump master process requests shared locks on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the master process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the master process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the master connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n schema", "--schema= schema"], "summary": "Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "signature": "-n schema --schema= schema", "source_url": "/docs/11/app-pgdump.html", "description": "Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N schema", "--exclude-schema= schema"], "summary": "Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N schema --exclude-schema= schema", "source_url": "/docs/11/app-pgdump.html", "description": "Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-o", "--oids"], "summary": "Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used.", "signature": "-o --oids", "source_url": "/docs/11/app-pgdump.html", "description": "Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/11/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/11/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data.", "signature": "-s --schema-only", "source_url": "/docs/11/app-pgdump.html", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/11/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t table", "--table= table"], "summary": "Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "signature": "-t table --table= table", "source_url": "/docs/11/app-pgdump.html", "description": "Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab ."}, {"names": ["-T table", "--exclude-table= table"], "summary": "Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T table --exclude-table= table", "source_url": "/docs/11/app-pgdump.html", "description": "Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.", "signature": "-v --verbose", "source_url": "/docs/11/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/11/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/11/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "signature": "-Z 0..9 --compress= 0..9", "source_url": "/docs/11/app-pgdump.html", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/11/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/11/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/11/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/11/app-pgdump.html", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/11/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= table"], "summary": "Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= table", "source_url": "/docs/11/app-pgdump.html", "description": "Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/11/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/11/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/11/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/11/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump comments.", "signature": "--no-comments", "source_url": "/docs/11/app-pgdump.html", "description": "Do not dump comments."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/11/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/11/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/11/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/11/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "signature": "--no-synchronized-snapshots", "source_url": "/docs/11/app-pgdump.html", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/11/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/11/app-pgdump.html", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/11/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/11/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/11/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/11/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "summary": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/11/app-pgdump.html", "description": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/11/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/11/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/11/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/11/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/11/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/11/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/11/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/11/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/11/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=11", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v11.22/postgresql-11.22.tar.bz2", "label": "11.22", "major": "11", "channel": "historical", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/11/postgresql-11-A4.pdf", "bytes": 13057499, "pages": 2732, "sha256": "41d75855e610d0d9b8802b87dc5b080bef8d7e91c7cf69401fbf8d3cf801b4b5", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/11/postgresql-11-US.pdf", "bytes": 12961189, "pages": 2883, "sha256": "6a8899ef36935a5b7ed2b436207564a567a4ef1eb1c2200195876b8de4d4fa30", "built_at": "2026-09-26"}}, "tree": "11", "index": "index.html", "major": "11", "pages": 1125, "release": "11.22", "source_url": "https://ftp.postgresql.org/pub/source/v11.22/postgresql-11.22.tar.bz2", "svg_assets": 0, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0"}, "revision": "53315ddaf3b3f9e6669fd1edc096bbb2cd4a65ea3e836c89e542b43af9ba3a7f", "evidence_kind": "English manual and source declarations", "source_sha256": "2cb7c97d7a0d7278851bbc9c61f467b69c094c72b81740b751108e7892ebe1f0"}, "sources": [{"url": "https://pg.center/docs/11/app-pgdump.html", "file": "app-pgdump.html", "label": "11.22 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "89e75cd7cd3fa712860d671625758ec0fed13f80603cbfb70cb661a6f8bd4889", "language": "en", "original_url": "/docs/11/app-pgdump.html"}, {"url": "https://pg.center/docs/11/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "3a30e696058b118a55cc42892c39671d9bae86f77e1024d5ebcc4688ad9ab4c3", "language": "en", "original_url": "/docs/11/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06\u4e00\u4e2a PostgreSQL \u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\">pg_dump</span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06\u4e00\u4e2a<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.12.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u662f\u4e00\u4e2a\u7528\u4e8e\u5907\u4efd<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5907\u4efd\u3002<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5907\u4efd\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5907\u4efd\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/11/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/11/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/11/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\">pg_restore</span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5907\u4efd\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86<code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u6216<code class=\"option\">--schema-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code>\u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528<code class=\"option\">--data-only</code>\u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528<code class=\"option\">--schema-only</code>\u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/11/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u4e3b\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u4e3b\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u83b7\u5f97\u4e00\u81f4\u7684\u5907\u4efd\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u4e3b\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u8981\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u5fc5\u987b\u786e\u4fdd\u4ece\u4e3b\u63a7\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u5230\u6700\u540e\u4e00\u4e2a\u5de5\u4f5c\u4efb\u52a1\u8fde\u63a5\u6570\u636e\u5e93\u8fd9\u6bb5\u65f6\u95f4\u5185\uff0c\u6570\u636e\u5e93\u5185\u5bb9\u4e0d\u53d1\u751f\u53d8\u5316\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u5728\u5f00\u59cb\u5907\u4efd\u4e4b\u524d\uff0c\u505c\u6b62\u6240\u6709\u8bbf\u95ee\u8be5\u6570\u636e\u5e93\u5e76\u4fee\u6539\u6570\u636e\u7684\u8fdb\u7a0b\uff08DDL \u548c DML\uff09\u3002\u5bf9 9.2 \u4e4b\u524d\u7684 PostgreSQL \u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \u65f6\uff0c\u8fd8\u5fc5\u987b\u6307\u5b9a --no-synchronized-snapshots \u53c2\u6570\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>schema</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>schema</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>schema</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/11/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/11/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--blobs</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>schema</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>schema</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u540d\u79f0\u5339\u914d<em class=\"replaceable\"><code>schema</code></em>\u7684\u6a21\u5f0f\u3002\u8be5\u5339\u914d\u6761\u4ef6\u6309\u7167\u4e0e<code class=\"option\">-n</code>\u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a<code class=\"option\">-N</code>\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6761\u4ef6\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o</code><br/></span><span class=\"term\"><code class=\"option\">--oids</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5c06\u5bf9\u8c61\u6807\u8bc6\u7b26\uff08OID\uff09\u4f5c\u4e3a\u6bcf\u4e2a\u8868\u7684\u6570\u636e\u7684\u4e00\u90e8\u5206\u8fdb\u884c\u8f6c\u50a8\u3002\u5982\u679c\u5e94\u7528\u4ee5\u67d0\u79cd\u65b9\u5f0f\u5f15\u7528\u4e86 OID \u5217\uff08\u4f8b\u5982\u5916\u952e\u7ea6\u675f\uff09\uff0c\u5e94\u4f7f\u7528\u6b64\u9009\u9879\uff1b\u5426\u5219\u4e0d\u5e94\u4f7f\u7528\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0e<code class=\"option\">--data-only</code>\u7684\u4f5c\u7528\u76f8\u53cd\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a<code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u7531\u4e8e\u5386\u53f2\u539f\u56e0\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>table</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>table</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>table</code></em> \u7684\u8868\u3002\u8fd9\u91cc\uff0c<span class=\"quote\">\u201c<span class=\"quote\">\u8868</span>\u201d</span>\u5305\u62ec\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5e8f\u5217\u548c\u5916\u90e8\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>table</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/11/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/11/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\"><code class=\"option\">-t</code>\u5f00\u5173\u7684\u884c\u4e3a\u4e0e 8.2 \u4e4b\u524d\u7684<span class=\"productname\">PostgreSQL</span>\u7248\u672c\u5e76\u4e0d\u5b8c\u5168\u5411\u4e0a\u517c\u5bb9\u3002\u4ee5\u524d\uff0c\u5199\u6210<code class=\"literal\">-t tab</code>\u4f1a\u8f6c\u50a8\u6240\u6709\u540d\u4e3a<code class=\"literal\">tab</code>\u7684\u8868\uff0c\u73b0\u5728\u5219\u53ea\u8f6c\u50a8\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84\u4e2d\u53ef\u89c1\u7684\u90a3\u4e2a\u8868\u3002\u8981\u83b7\u5f97\u65e7\u884c\u4e3a\uff0c\u53ef\u4ee5\u5199\u6210<code class=\"literal\">-t '*.tab'</code>\u3002\u6b64\u5916\uff0c\u8981\u9009\u62e9\u7279\u5b9a\u6a21\u5f0f\u4e2d\u7684\u8868\uff0c\u5fc5\u987b\u5199\u6210\u7c7b\u4f3c<code class=\"literal\">-t sch.tab</code>\u7684\u5f62\u5f0f\uff0c\u800c\u4e0d\u662f\u65e7\u7684<code class=\"literal\">-n sch -t tab</code>\u5199\u6cd5\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>table</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>table</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>table</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>0..9</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>0..9</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9<span class=\"application\">gzip</span>\u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4 (<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>)\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u6b64\u9009\u9879\u4e3a\u6bcf\u4e00\u884c\u751f\u6210\u5355\u72ec\u7684\u547d\u4ee4\uff0c\u6062\u590d\u67d0\u4e00\u884c\u65f6\u51fa\u9519\u53ea\u4f1a\u5bfc\u81f4\u8be5\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/11/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/11/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>table</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d<em class=\"replaceable\"><code>table</code></em>\u6a21\u5f0f\u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e<code class=\"option\">-t</code>\u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a<code class=\"option\">--exclude-table-data</code>\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u8868\u7684\u5b9a\u4e49\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u7684\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u9605<code class=\"option\">--schema-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08\u800c\u4e0d\u662f<code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u8f7d\u5230\u975e<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u4e0d\u8fc7\uff0c\u7531\u4e8e\u6b64\u9009\u9879\u4e3a\u6bcf\u4e00\u884c\u751f\u6210\u5355\u72ec\u7684\u547d\u4ee4\uff0c\u6062\u590d\u67d0\u4e00\u884c\u65f6\u51fa\u9519\u53ea\u4f1a\u5bfc\u81f4\u8be5\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u6392\u5217\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5b8c\u5168\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code>\u9009\u9879\u4e0d\u53d7\u5217\u987a\u5e8f\u53d8\u5316\u5f71\u54cd\uff0c\u4f46\u4f1a\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-synchronized-snapshots</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c<code class=\"command\">pg_dump -j</code>\uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605<code class=\"option\">-j</code>\u53c2\u6570\u7684\u6587\u6863\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">data \u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u548c\u5e8f\u5217\u503c\u3002post-data \u90e8\u5206\u5305\u542b\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u542b\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/11/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/11/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.82.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.82</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/11/logicaldecoding.html\" title=\"\u7b2c\u00a049\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a049\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u9650\u5b9a\u6761\u4ef6\u81f3\u5c11\u5339\u914d\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5f0f\u6216\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6a21\u5f0f\u548c\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c<span class=\"application\">pg_dump</span>\u5373\u4f7f\u6ca1\u6709\u4f7f\u7528<code class=\"option\">--strict-names</code>\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u5f71\u54cd<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code>\u6216<code class=\"option\">--exclude-table-data</code>\u3002\u6392\u9664\u6a21\u5f0f\u672a\u5339\u914d\u5230\u4efb\u4f55\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/11/libpq.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u7ecf\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.12.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/11/libpq-envars.html\" title=\"34.14.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a034.14\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/11/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7edf\u8ba1\u6536\u96c6\u5668\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4ec5\u6570\u636e\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e0d\u5305\u542b\u4f18\u5316\u5668\u7528\u4e8e\u51b3\u5b9a\u67e5\u8be2\u8ba1\u5212\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\uff0c\u6700\u597d\u8fd0\u884c<code class=\"command\">ANALYZE</code>\u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff1b\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/11/maintenance.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/11/maintenance.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 8.0 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u5c06\u540d\u4e3a <code class=\"literal\">mydb</code> \u7684\u6570\u636e\u5e93\u8f6c\u50a8\u5230 SQL \u811a\u672c\u6587\u4ef6\u4e2d\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\uff0c\u5982\u679c\u8981\u6307\u5b9a\u4e00\u4e2a\u5927\u5199\u6216\u6df7\u5408\u5927\u5c0f\u5199\u7684\u540d\u79f0\uff0c\u5c31\u9700\u8981\u5bf9\u8be5\u540d\u79f0\u52a0\u53cc\u5f15\u53f7\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u6210\u5c0f\u5199\uff08\u89c1<a class=\"xref\" href=\"/docs/11/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u201c\u6a21\u5f0f\u201d\u4e00\u8282</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6765\u8bf4\u53c8\u662f\u7279\u6b8a\u5b57\u7b26\uff0c\u56e0\u6b64\u53cd\u8fc7\u6765\u8fd8\u5fc5\u987b\u518d\u88ab\u5f15\u7528\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u5177\u6709\u6df7\u5408\u5927\u5c0f\u5199\u540d\u79f0\u7684\u5355\u4e2a\u8868\uff0c\u9700\u8981\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.12.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/11/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/11/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\">pg_restore</span></a>, <a class=\"xref\" href=\"https://pg.center/docs/11/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/11/app-pgdump.html", "method": "same-major semantic node", "sha256": "8e07e35f968e5d4f2bc1e800ac8aaf7371c6d38a5247fe15e8ee18b3f980e5e3", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[1]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/11/description/0": "pg_dump \u2014 extract a PostgreSQL database into a script file or other archive file", "/versions/11/facts/0/label": "Documented executable", "/versions/11/facts/1/label": "Executable version", "/versions/11/facts/2/label": "Reference inventory", "/versions/11/facts/2/value": "Client applications", "/versions/11/facts/3/label": "Option definition groups", "/versions/11/tables/0/title": "Documented options", "/versions/11/tables/1/title": "Environment variables", "/versions/11/related/0/label": "libpq connection parameters", "/versions/11/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "/versions/11/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "/versions/11/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/11/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/11/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/11/tables/0/rows/5/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)", "/versions/11/tables/0/rows/6/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/11/tables/0/rows/7/summary": "Selects the format of the output. format can be one of the following:", "/versions/11/tables/0/rows/8/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/11/tables/0/rows/9/summary": "Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "/versions/11/tables/0/columns/0/label": "Option and arguments", "/versions/11/tables/0/columns/1/label": "Description", "/versions/11/tables/0/rows/10/summary": "Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/11/tables/0/rows/11/summary": "Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used.", "/versions/11/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/11/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/11/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data.", "/versions/11/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/11/tables/0/rows/16/summary": "Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "/versions/11/tables/0/rows/17/summary": "Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/11/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.", "/versions/11/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/11/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/11/tables/0/rows/21/summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "/versions/11/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/11/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents.", "/versions/11/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/11/tables/0/rows/25/summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/11/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/11/tables/0/rows/27/summary": "Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/11/tables/0/rows/28/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/11/tables/0/rows/29/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/11/tables/0/rows/30/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/11/tables/0/rows/31/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/11/tables/0/rows/32/summary": "Do not dump comments.", "/versions/11/tables/0/rows/33/summary": "Do not dump publications.", "/versions/11/tables/0/rows/34/summary": "Do not dump security labels.", "/versions/11/tables/0/rows/35/summary": "Do not dump subscriptions.", "/versions/11/tables/0/rows/36/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/11/tables/0/rows/37/summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "/versions/11/tables/0/rows/38/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/11/tables/0/rows/39/summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "/versions/11/tables/0/rows/40/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/11/tables/0/rows/41/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/11/tables/0/rows/42/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/11/tables/0/rows/43/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details).", "/versions/11/tables/0/rows/44/summary": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "/versions/11/tables/0/rows/45/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/11/tables/0/rows/46/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/11/tables/0/rows/47/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/11/tables/0/rows/48/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/11/tables/0/rows/49/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/11/tables/0/rows/50/summary": "User name to connect as.", "/versions/11/tables/0/rows/51/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/11/tables/0/rows/52/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/11/tables/0/rows/53/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/11/tables/1/columns/0/label": "Variable", "/versions/11/tables/1/columns/1/label": "Meaning", "/versions/11/tables/1/rows/0/description": "Default connection parameters."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "4fc4a2ebd4838ff2b797cfac2301e367426e1ce4f07d12ea8db2344063fde885"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "signature": "-b --blobs", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "signature": "-B --no-blobs", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump master process requests shared locks on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the master process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the master process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the master connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n schema", "--schema= schema"], "signature": "-n schema --schema= schema", "description": "Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N schema", "--exclude-schema= schema"], "signature": "-N schema --exclude-schema= schema", "description": "Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-o", "--oids"], "signature": "-o --oids", "description": "Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t table", "--table= table"], "signature": "-t table --table= table", "description": "Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab ."}, {"names": ["-T table", "--exclude-table= table"], "signature": "-T table --exclude-table= table", "description": "Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "signature": "-Z 0..9 --compress= 0..9", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= table"], "signature": "--exclude-table-data= table", "description": "Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump comments."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "signature": "--no-synchronized-snapshots", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}]}, "comparison_hash": "355fc617da5a629d99646a3a0f1a55309f2517b6dff7569721372cfe44925efa", "manual_language": "zh"}, "12": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "12.22"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "56"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u6216 --schema-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-b --blobs"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-B --no-blobs"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u8fd9\u91cc\uff0c \u201c \u8868 \u201d \u5305\u62ec\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5e8f\u5217\u548c\u5916\u90e8\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9 gzip \u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-Z 0..9 --compress= 0..9"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4 ( INSERT INTO table ( column , ...) VALUES ... )\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605 -j \u53c2\u6570\u7684\u6587\u6863\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--no-synchronized-snapshots"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.87 \uff09\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u9650\u5b9a\u6761\u4ef6\u81f3\u5c11\u5339\u914d\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5f0f\u6216\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6a21\u5f0f\u548c\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c pg_dump \u5373\u4f7f\u6ca1\u6709\u4f7f\u7528 --strict-names \u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u7ecf\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/12/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/12/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "signature": "-b --blobs", "source_url": "/docs/12/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-blobs", "source_url": "/docs/12/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/12/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/12/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/12/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/12/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/12/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/12/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump master process requests shared locks on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the master process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the master process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the master connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "signature": "-n pattern --schema= pattern", "source_url": "/docs/12/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/12/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/12/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/12/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data.", "signature": "-s --schema-only", "source_url": "/docs/12/app-pgdump.html", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/12/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "signature": "-t pattern --table= pattern", "source_url": "/docs/12/app-pgdump.html", "description": "Dump only tables with names matching pattern . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab ."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/12/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.", "signature": "-v --verbose", "source_url": "/docs/12/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/12/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/12/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "signature": "-Z 0..9 --compress= 0..9", "source_url": "/docs/12/app-pgdump.html", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/12/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/12/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/12/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/12/app-pgdump.html", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/12/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/12/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/12/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/12/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/12/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/12/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/12/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump comments.", "signature": "--no-comments", "source_url": "/docs/12/app-pgdump.html", "description": "Do not dump comments."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/12/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/12/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/12/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/12/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "signature": "--no-synchronized-snapshots", "source_url": "/docs/12/app-pgdump.html", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/12/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/12/app-pgdump.html", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/12/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/12/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/12/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/12/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/12/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.87 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/12/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.87 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 48 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "summary": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/12/app-pgdump.html", "description": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/12/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/12/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/12/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/12/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/12/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/12/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/12/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/12/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/12/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=12", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "label": "12.22", "major": "12", "channel": "historical", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/12/postgresql-12-A4.pdf", "bytes": 13424351, "pages": 2803, "sha256": "7422cf53fd1939e7a3d2925231a88b0330e468afa5393627cac0ff86158a0621", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/12/postgresql-12-US.pdf", "bytes": 13322565, "pages": 2958, "sha256": "51f3b04e72907fc38512685946223452ea65f84419c60c66241dfa3396035e77", "built_at": "2026-09-26"}}, "tree": "12", "index": "index.html", "major": "12", "pages": 1131, "release": "12.22", "source_url": "https://ftp.postgresql.org/pub/source/v12.22/postgresql-12.22.tar.bz2", "svg_assets": 2, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b"}, "revision": "7a827e97cbfacd7febff75f34443e2043e40723de5b6d8c9d81a9430b65a37e4", "evidence_kind": "English manual and source declarations", "source_sha256": "8df3c0474782589d3c6f374b5133b1bd14d168086edbc13c6e72e67dd4527a3b"}, "sources": [{"url": "https://pg.center/docs/12/app-pgdump.html", "file": "app-pgdump.html", "label": "12.22 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "1696b371ad74d181dc249929d2331d2f8ba5a201a6a6dd6544aae7dc85e1c2f1", "language": "en", "original_url": "/docs/12/app-pgdump.html"}, {"url": "https://pg.center/docs/12/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "089624dd131f52eea682b304f87a1acb03392ee7bcf78b000699c9b17c7ca22d", "language": "en", "original_url": "/docs/12/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06\u4e00\u4e2a PostgreSQL \u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\">pg_dump</span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06\u4e00\u4e2a<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.12.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u662f\u4e00\u4e2a\u7528\u4e8e\u5907\u4efd<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5907\u4efd\u3002<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5907\u4efd\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5907\u4efd\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/12/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/12/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/12/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\">pg_restore</span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5907\u4efd\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86<code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u6216<code class=\"option\">--schema-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code>\u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528<code class=\"option\">--data-only</code>\u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528<code class=\"option\">--schema-only</code>\u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/12/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u4e3b\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u4e3b\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u83b7\u5f97\u4e00\u81f4\u7684\u5907\u4efd\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u4e3b\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u8981\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u5fc5\u987b\u786e\u4fdd\u4ece\u4e3b\u63a7\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u5230\u6700\u540e\u4e00\u4e2a\u5de5\u4f5c\u4efb\u52a1\u8fde\u63a5\u6570\u636e\u5e93\u8fd9\u6bb5\u65f6\u95f4\u5185\uff0c\u6570\u636e\u5e93\u5185\u5bb9\u4e0d\u53d1\u751f\u53d8\u5316\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u5728\u5f00\u59cb\u5907\u4efd\u4e4b\u524d\uff0c\u505c\u6b62\u6240\u6709\u8bbf\u95ee\u8be5\u6570\u636e\u5e93\u5e76\u4fee\u6539\u6570\u636e\u7684\u8fdb\u7a0b\uff08DDL \u548c DML\uff09\u3002\u5bf9 9.2 \u4e4b\u524d\u7684 PostgreSQL \u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \u65f6\uff0c\u8fd8\u5fc5\u987b\u6307\u5b9a --no-synchronized-snapshots \u53c2\u6570\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/12/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/12/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--blobs</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0e<code class=\"option\">--data-only</code>\u7684\u4f5c\u7528\u76f8\u53cd\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a<code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u7531\u4e8e\u5386\u53f2\u539f\u56e0\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8fd9\u91cc\uff0c<span class=\"quote\">\u201c<span class=\"quote\">\u8868</span>\u201d</span>\u5305\u62ec\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5e8f\u5217\u548c\u5916\u90e8\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/12/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/12/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\"><code class=\"option\">-t</code>\u5f00\u5173\u7684\u884c\u4e3a\u4e0e 8.2 \u4e4b\u524d\u7684<span class=\"productname\">PostgreSQL</span>\u7248\u672c\u5e76\u4e0d\u5b8c\u5168\u5411\u4e0a\u517c\u5bb9\u3002\u4ee5\u524d\uff0c\u5199\u6210<code class=\"literal\">-t tab</code>\u4f1a\u8f6c\u50a8\u6240\u6709\u540d\u4e3a<code class=\"literal\">tab</code>\u7684\u8868\uff0c\u73b0\u5728\u5219\u53ea\u8f6c\u50a8\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84\u4e2d\u53ef\u89c1\u7684\u90a3\u4e2a\u8868\u3002\u8981\u83b7\u5f97\u65e7\u884c\u4e3a\uff0c\u53ef\u4ee5\u5199\u6210<code class=\"literal\">-t '*.tab'</code>\u3002\u6b64\u5916\uff0c\u8981\u9009\u62e9\u7279\u5b9a\u6a21\u5f0f\u4e2d\u7684\u8868\uff0c\u5fc5\u987b\u5199\u6210\u7c7b\u4f3c<code class=\"literal\">-t sch.tab</code>\u7684\u5f62\u5f0f\uff0c\u800c\u4e0d\u662f\u65e7\u7684<code class=\"literal\">-n sch -t tab</code>\u5199\u6cd5\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>0..9</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>0..9</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9<span class=\"application\">gzip</span>\u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4 (<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>)\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/12/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/12/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u9605<code class=\"option\">--schema-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-synchronized-snapshots</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c<code class=\"command\">pg_dump -j</code>\uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605<code class=\"option\">-j</code>\u53c2\u6570\u7684\u6587\u6863\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">data \u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u548c\u5e8f\u5217\u503c\u3002post-data \u90e8\u5206\u5305\u542b\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u542b\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/12/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/12/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.87.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.87</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/12/logicaldecoding.html\" title=\"\u7b2c\u00a048\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a048\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u9650\u5b9a\u6761\u4ef6\u81f3\u5c11\u5339\u914d\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5f0f\u6216\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6a21\u5f0f\u548c\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c<span class=\"application\">pg_dump</span>\u5373\u4f7f\u6ca1\u6709\u4f7f\u7528<code class=\"option\">--strict-names</code>\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u5f71\u54cd<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code>\u6216<code class=\"option\">--exclude-table-data</code>\u3002\u6392\u9664\u6a21\u5f0f\u672a\u5339\u914d\u5230\u4efb\u4f55\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/12/libpq.html#LIBPQ-CONNSTRING\" title=\"33.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u7ecf\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.12.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/12/libpq-envars.html\" title=\"33.14.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a033.14\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/12/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7edf\u8ba1\u6536\u96c6\u5668\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4ec5\u6570\u636e\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e0d\u5305\u542b\u4f18\u5316\u5668\u7528\u4e8e\u51b3\u5b9a\u67e5\u8be2\u8ba1\u5212\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\uff0c\u6700\u597d\u8fd0\u884c<code class=\"command\">ANALYZE</code>\u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff1b\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/12/maintenance.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/12/maintenance.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 8.0 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u5c06\u540d\u4e3a <code class=\"literal\">mydb</code> \u7684\u6570\u636e\u5e93\u8f6c\u50a8\u5230 SQL \u811a\u672c\u6587\u4ef6\u4e2d\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\uff0c\u5982\u679c\u8981\u6307\u5b9a\u4e00\u4e2a\u5927\u5199\u6216\u6df7\u5408\u5927\u5c0f\u5199\u7684\u540d\u79f0\uff0c\u5c31\u9700\u8981\u5bf9\u8be5\u540d\u79f0\u52a0\u53cc\u5f15\u53f7\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u6210\u5c0f\u5199\uff08\u89c1<a class=\"xref\" href=\"/docs/12/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u201c\u6a21\u5f0f\u201d\u4e00\u8282</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6765\u8bf4\u53c8\u662f\u7279\u6b8a\u5b57\u7b26\uff0c\u56e0\u6b64\u53cd\u8fc7\u6765\u8fd8\u5fc5\u987b\u518d\u88ab\u5f15\u7528\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u5177\u6709\u6df7\u5408\u5927\u5c0f\u5199\u540d\u79f0\u7684\u5355\u4e2a\u8868\uff0c\u9700\u8981\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.12.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/12/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/12/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\">pg_restore</span></a>, <a class=\"xref\" href=\"https://pg.center/docs/12/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/12/app-pgdump.html", "method": "same-major semantic node", "sha256": "0e10e9451d31e492f75925a530341045297528cd770891b4fea904c70129e05a", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[1]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/12/description/0": "pg_dump \u2014 extract a PostgreSQL database into a script file or other archive file", "/versions/12/facts/0/label": "Documented executable", "/versions/12/facts/1/label": "Executable version", "/versions/12/facts/2/label": "Reference inventory", "/versions/12/facts/2/value": "Client applications", "/versions/12/facts/3/label": "Option definition groups", "/versions/12/tables/0/title": "Documented options", "/versions/12/tables/1/title": "Environment variables", "/versions/12/related/0/label": "libpq connection parameters", "/versions/12/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "/versions/12/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "/versions/12/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/12/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/12/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/12/tables/0/rows/5/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)", "/versions/12/tables/0/rows/6/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/12/tables/0/rows/7/summary": "Selects the format of the output. format can be one of the following:", "/versions/12/tables/0/rows/8/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/12/tables/0/rows/9/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "/versions/12/tables/0/columns/0/label": "Option and arguments", "/versions/12/tables/0/columns/1/label": "Description", "/versions/12/tables/0/rows/10/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/12/tables/0/rows/11/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/12/tables/0/rows/12/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/12/tables/0/rows/13/summary": "Dump only the object definitions (schema), not data.", "/versions/12/tables/0/rows/14/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/12/tables/0/rows/15/summary": "Dump only tables with names matching pattern . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples .", "/versions/12/tables/0/rows/16/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/12/tables/0/rows/17/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.", "/versions/12/tables/0/rows/18/summary": "Print the pg_dump version and exit.", "/versions/12/tables/0/rows/19/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/12/tables/0/rows/20/summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "/versions/12/tables/0/rows/21/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/12/tables/0/rows/22/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/12/tables/0/rows/23/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/12/tables/0/rows/24/summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/12/tables/0/rows/25/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/12/tables/0/rows/26/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/12/tables/0/rows/27/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/12/tables/0/rows/28/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/12/tables/0/rows/29/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/12/tables/0/rows/30/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/12/tables/0/rows/31/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/12/tables/0/rows/32/summary": "Do not dump comments.", "/versions/12/tables/0/rows/33/summary": "Do not dump publications.", "/versions/12/tables/0/rows/34/summary": "Do not dump security labels.", "/versions/12/tables/0/rows/35/summary": "Do not dump subscriptions.", "/versions/12/tables/0/rows/36/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/12/tables/0/rows/37/summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "/versions/12/tables/0/rows/38/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/12/tables/0/rows/39/summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "/versions/12/tables/0/rows/40/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/12/tables/0/rows/41/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/12/tables/0/rows/42/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/12/tables/0/rows/43/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/12/tables/0/rows/44/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/12/tables/0/rows/45/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.87 for more details).", "/versions/12/tables/0/rows/46/summary": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "/versions/12/tables/0/rows/47/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/12/tables/0/rows/48/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/12/tables/0/rows/49/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/12/tables/0/rows/50/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/12/tables/0/rows/51/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/12/tables/0/rows/52/summary": "User name to connect as.", "/versions/12/tables/0/rows/53/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/12/tables/0/rows/54/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/12/tables/0/rows/55/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/12/tables/1/columns/0/label": "Variable", "/versions/12/tables/1/columns/1/label": "Meaning", "/versions/12/tables/1/rows/0/description": "Default connection parameters.", "/versions/12/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "97df897332404bf1da8cbe5e8c0fa3d7ee37492a929035e57919d5fa7c1d75c5"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "signature": "-b --blobs", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "signature": "-B --no-blobs", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option reduces the time of the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump master process requests shared locks on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the master process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the master process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the master connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab ."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "signature": "-Z 0..9 --compress= 0..9", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump comments."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "signature": "--no-synchronized-snapshots", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.87 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 48 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "dd96f8017b548a3f104bce2b0d469d93100b593a7aa8bc25185ccf203007b07b", "manual_language": "zh"}, "13": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "13.23"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "58"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u6216 --schema-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-b --blobs"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-B --no-blobs"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9 gzip \u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-Z 0..9 --compress= 0..9"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4 ( INSERT INTO table ( column , ...) VALUES ... )\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605 -j \u53c2\u6570\u7684\u6587\u6863\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--no-synchronized-snapshots"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.88 \uff09\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u9650\u5b9a\u6761\u4ef6\u81f3\u5c11\u5339\u914d\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5f0f\u6216\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6a21\u5f0f\u548c\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c pg_dump \u5373\u4f7f\u6ca1\u6709\u4f7f\u7528 --strict-names \u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u7ecf\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/13/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/13/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "signature": "-b --blobs", "source_url": "/docs/13/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-blobs", "source_url": "/docs/13/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/13/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/13/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/13/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/13/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/13/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/13/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump master process requests shared locks on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the master process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the master process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the master connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/13/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/13/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/13/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/13/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data.", "signature": "-s --schema-only", "source_url": "/docs/13/app-pgdump.html", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/13/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/13/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab ."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/13/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.", "signature": "-v --verbose", "source_url": "/docs/13/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/13/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/13/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "signature": "-Z 0..9 --compress= 0..9", "source_url": "/docs/13/app-pgdump.html", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/13/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/13/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/13/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/13/app-pgdump.html", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/13/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/13/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/13/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/13/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/13/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/13/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/13/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/13/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump comments.", "signature": "--no-comments", "source_url": "/docs/13/app-pgdump.html", "description": "Do not dump comments."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/13/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/13/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/13/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/13/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "signature": "--no-synchronized-snapshots", "source_url": "/docs/13/app-pgdump.html", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/13/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/13/app-pgdump.html", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/13/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/13/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/13/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/13/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/13/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/13/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.88 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/13/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.88 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 48 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "summary": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/13/app-pgdump.html", "description": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/13/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/13/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/13/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/13/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/13/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/13/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/13/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/13/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/13/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=13", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "label": "13.23", "major": "13", "channel": "historical", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/13/postgresql-13-A4.pdf", "bytes": 13843239, "pages": 2826, "sha256": "171cc09f90936dbc1cbd503a98ff07ae72ea58ab9771ff051313f1217737799c", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/13/postgresql-13-US.pdf", "bytes": 13739572, "pages": 2984, "sha256": "48d09c6e197d9db4220f41afe83efe848a8661b1b168d3b89419751ecaf6c24d", "built_at": "2026-09-26"}}, "tree": "13", "index": "index.html", "major": "13", "pages": 1139, "release": "13.23", "source_url": "https://ftp.postgresql.org/pub/source/v13.23/postgresql-13.23.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6"}, "revision": "614ee3133270254e476c118cdf6f72af78d4e4b8bbd9b28ed9ab1e14e4e9c0f6", "evidence_kind": "English manual and source declarations", "source_sha256": "6ec3c82726af92b7dec873fa1cdf881eca92a4219787dfad05acb6b10e041fd6"}, "sources": [{"url": "https://pg.center/docs/13/app-pgdump.html", "file": "app-pgdump.html", "label": "13.23 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "5f49d3ad076ce3e43e4006c066836f8f794a4b0b0d3c5751373143e4233bfa43", "language": "en", "original_url": "/docs/13/app-pgdump.html"}, {"url": "https://pg.center/docs/13/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "2a16c2982d9803edd4bd6920f76b66083e7f2959182d6a3bcec7ccfbac0a9ad8", "language": "en", "original_url": "/docs/13/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06\u4e00\u4e2a PostgreSQL \u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\">pg_dump</span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06\u4e00\u4e2a<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.12.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u662f\u4e00\u4e2a\u7528\u4e8e\u5907\u4efd<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5907\u4efd\u3002<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5907\u4efd\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5907\u4efd\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/13/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/13/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/13/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\">pg_restore</span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5907\u4efd\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86<code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u6216<code class=\"option\">--schema-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code>\u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528<code class=\"option\">--data-only</code>\u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528<code class=\"option\">--schema-only</code>\u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/13/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u4e3b\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u4e3b\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u83b7\u5f97\u4e00\u81f4\u7684\u5907\u4efd\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u4e3b\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u8981\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u5fc5\u987b\u786e\u4fdd\u4ece\u4e3b\u63a7\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u5230\u6700\u540e\u4e00\u4e2a\u5de5\u4f5c\u4efb\u52a1\u8fde\u63a5\u6570\u636e\u5e93\u8fd9\u6bb5\u65f6\u95f4\u5185\uff0c\u6570\u636e\u5e93\u5185\u5bb9\u4e0d\u53d1\u751f\u53d8\u5316\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u5728\u5f00\u59cb\u5907\u4efd\u4e4b\u524d\uff0c\u505c\u6b62\u6240\u6709\u8bbf\u95ee\u8be5\u6570\u636e\u5e93\u5e76\u4fee\u6539\u6570\u636e\u7684\u8fdb\u7a0b\uff08DDL \u548c DML\uff09\u3002\u5bf9 9.2 \u4e4b\u524d\u7684 PostgreSQL \u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \u65f6\uff0c\u8fd8\u5fc5\u987b\u6307\u5b9a --no-synchronized-snapshots \u53c2\u6570\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/13/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/13/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--blobs</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0e<code class=\"option\">--data-only</code>\u7684\u4f5c\u7528\u76f8\u53cd\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a<code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u7531\u4e8e\u5386\u53f2\u539f\u56e0\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/13/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/13/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\"><code class=\"option\">-t</code>\u5f00\u5173\u7684\u884c\u4e3a\u4e0e 8.2 \u4e4b\u524d\u7684<span class=\"productname\">PostgreSQL</span>\u7248\u672c\u5e76\u4e0d\u5b8c\u5168\u5411\u4e0a\u517c\u5bb9\u3002\u4ee5\u524d\uff0c\u5199\u6210<code class=\"literal\">-t tab</code>\u4f1a\u8f6c\u50a8\u6240\u6709\u540d\u4e3a<code class=\"literal\">tab</code>\u7684\u8868\uff0c\u73b0\u5728\u5219\u53ea\u8f6c\u50a8\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84\u4e2d\u53ef\u89c1\u7684\u90a3\u4e2a\u8868\u3002\u8981\u83b7\u5f97\u65e7\u884c\u4e3a\uff0c\u53ef\u4ee5\u5199\u6210<code class=\"literal\">-t '*.tab'</code>\u3002\u6b64\u5916\uff0c\u8981\u9009\u62e9\u7279\u5b9a\u6a21\u5f0f\u4e2d\u7684\u8868\uff0c\u5fc5\u987b\u5199\u6210\u7c7b\u4f3c<code class=\"literal\">-t sch.tab</code>\u7684\u5f62\u5f0f\uff0c\u800c\u4e0d\u662f\u65e7\u7684<code class=\"literal\">-n sch -t tab</code>\u5199\u6cd5\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>0..9</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>0..9</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9<span class=\"application\">gzip</span>\u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4 (<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>)\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/13/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/13/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u9605<code class=\"option\">--schema-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/13/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/13/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-synchronized-snapshots</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c<code class=\"command\">pg_dump -j</code>\uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605<code class=\"option\">-j</code>\u53c2\u6570\u7684\u6587\u6863\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">data \u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u548c\u5e8f\u5217\u503c\u3002post-data \u90e8\u5206\u5305\u542b\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u542b\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/13/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/13/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.88.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.88</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/13/logicaldecoding.html\" title=\"\u7b2c\u00a048\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a048\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u9650\u5b9a\u6761\u4ef6\u81f3\u5c11\u5339\u914d\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5f0f\u6216\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6a21\u5f0f\u548c\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c<span class=\"application\">pg_dump</span>\u5373\u4f7f\u6ca1\u6709\u4f7f\u7528<code class=\"option\">--strict-names</code>\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u5f71\u54cd<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code>\u6216<code class=\"option\">--exclude-table-data</code>\u3002\u6392\u9664\u6a21\u5f0f\u672a\u5339\u914d\u5230\u4efb\u4f55\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/13/libpq.html#LIBPQ-CONNSTRING\" title=\"33.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u7ecf\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.12.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/13/libpq-envars.html\" title=\"33.14.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a033.14\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/13/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7edf\u8ba1\u6536\u96c6\u5668\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4ec5\u6570\u636e\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e0d\u5305\u542b\u4f18\u5316\u5668\u7528\u4e8e\u51b3\u5b9a\u67e5\u8be2\u8ba1\u5212\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\uff0c\u6700\u597d\u8fd0\u884c<code class=\"command\">ANALYZE</code>\u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff1b\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/13/maintenance.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/13/maintenance.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 8.0 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u5c06\u540d\u4e3a <code class=\"literal\">mydb</code> \u7684\u6570\u636e\u5e93\u8f6c\u50a8\u5230 SQL \u811a\u672c\u6587\u4ef6\u4e2d\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\u6307\u5b9a\u5927\u5199\u6216\u5927\u5c0f\u5199\u6df7\u5408\u7684\u540d\u79f0\uff0c\u5fc5\u987b\u7528\u53cc\u5f15\u53f7\u62ec\u8d77\u8be5\u540d\u79f0\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u4e3a\u5c0f\u5199\uff08\u53c2\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/13/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u4e5f\u6709\u7279\u6b8a\u542b\u4e49\uff0c\u56e0\u6b64\u8fd8\u9700\u8981\u5c06\u53cc\u5f15\u53f7\u672c\u8eab\u7528\u5f15\u53f7\u62ec\u8d77\u3002\u6240\u4ee5\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u79f0\u5927\u5c0f\u5199\u6df7\u5408\u7684\u8868\uff0c\u9700\u8981\u4f7f\u7528\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.12.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/13/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/13/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\">pg_restore</span></a>, <a class=\"xref\" href=\"https://pg.center/docs/13/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/13/app-pgdump.html", "method": "same-major semantic node", "sha256": "2a70dd60c361f320109bf8995506225b82660999c3bc004f98d0346be65bb56d", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[1]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]/div[4]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/13/description/0": "pg_dump \u2014 extract a PostgreSQL database into a script file or other archive file", "/versions/13/facts/0/label": "Documented executable", "/versions/13/facts/1/label": "Executable version", "/versions/13/facts/2/label": "Reference inventory", "/versions/13/facts/2/value": "Client applications", "/versions/13/facts/3/label": "Option definition groups", "/versions/13/tables/0/title": "Documented options", "/versions/13/tables/1/title": "Environment variables", "/versions/13/related/0/label": "libpq connection parameters", "/versions/13/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "/versions/13/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "/versions/13/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/13/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/13/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/13/tables/0/rows/5/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)", "/versions/13/tables/0/rows/6/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/13/tables/0/rows/7/summary": "Selects the format of the output. format can be one of the following:", "/versions/13/tables/0/rows/8/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/13/tables/0/rows/9/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/13/tables/0/columns/0/label": "Option and arguments", "/versions/13/tables/0/columns/1/label": "Description", "/versions/13/tables/0/rows/10/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/13/tables/0/rows/11/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/13/tables/0/rows/12/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/13/tables/0/rows/13/summary": "Dump only the object definitions (schema), not data.", "/versions/13/tables/0/rows/14/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/13/tables/0/rows/15/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/13/tables/0/rows/16/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/13/tables/0/rows/17/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.", "/versions/13/tables/0/rows/18/summary": "Print the pg_dump version and exit.", "/versions/13/tables/0/rows/19/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/13/tables/0/rows/20/summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "/versions/13/tables/0/rows/21/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/13/tables/0/rows/22/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/13/tables/0/rows/23/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/13/tables/0/rows/24/summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/13/tables/0/rows/25/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/13/tables/0/rows/26/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/13/tables/0/rows/27/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/13/tables/0/rows/28/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/13/tables/0/rows/29/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/13/tables/0/rows/30/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/13/tables/0/rows/31/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/13/tables/0/rows/32/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/13/tables/0/rows/33/summary": "Do not dump comments.", "/versions/13/tables/0/rows/34/summary": "Do not dump publications.", "/versions/13/tables/0/rows/35/summary": "Do not dump security labels.", "/versions/13/tables/0/rows/36/summary": "Do not dump subscriptions.", "/versions/13/tables/0/rows/37/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/13/tables/0/rows/38/summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "/versions/13/tables/0/rows/39/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/13/tables/0/rows/40/summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "/versions/13/tables/0/rows/41/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/13/tables/0/rows/42/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/13/tables/0/rows/43/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/13/tables/0/rows/44/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/13/tables/0/rows/45/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/13/tables/0/rows/46/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/13/tables/0/rows/47/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.88 for more details).", "/versions/13/tables/0/rows/48/summary": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "/versions/13/tables/0/rows/49/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/13/tables/0/rows/50/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/13/tables/0/rows/51/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/13/tables/0/rows/52/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/13/tables/0/rows/53/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/13/tables/0/rows/54/summary": "User name to connect as.", "/versions/13/tables/0/rows/55/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/13/tables/0/rows/56/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/13/tables/0/rows/57/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/13/tables/1/columns/0/label": "Variable", "/versions/13/tables/1/columns/1/label": "Meaning", "/versions/13/tables/1/rows/0/description": "Default connection parameters.", "/versions/13/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "0e176dfdacbf6aa451662927edaf793d9ffacb72e3cfe87ad5d7b2b1d6155958"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "signature": "-b --blobs", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "signature": "-B --no-blobs", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.)"}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump master process requests shared locks on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the master process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the master process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the master connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab ."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "signature": "-Z 0..9 --compress= 0..9", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump comments."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "signature": "--no-synchronized-snapshots", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.88 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 48 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one schema/table in the database to be dumped. Note that if none of the schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "8704d768bea5e042661f4f5d82baad8afb446bb4b89f6c0828d15bf974ed25e7", "manual_language": "zh"}, "14": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "14.24"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "60"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u6216 --schema-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-b --blobs"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-B --no-blobs"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u4ec5\u8f6c\u50a8\u4e0e pattern \u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -e \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-e pattern --extension= pattern"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728 \u7b2c 24.3.1 \u8282 \u4e2d\u63cf\u8ff0\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9 gzip \u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-Z 0..9 --compress= 0..9"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4\uff08 INSERT INTO table ( column , ...) VALUES ... \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605 -j \u53c2\u6570\u7684\u6587\u6863\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-synchronized-snapshots"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e TOAST \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-toast-compression"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.90 \uff09\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08 -e / --extension \uff09\u3001\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u9650\u5b9a\u6761\u4ef6\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48\u5373\u4f7f\u4e0d\u4f7f\u7528 --strict-names \uff0c pg_dump \u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/14/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/14/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "signature": "-b --blobs", "source_url": "/docs/14/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-blobs", "source_url": "/docs/14/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/14/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/14/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "signature": "-e pattern --extension= pattern", "source_url": "/docs/14/app-pgdump.html", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 .", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/14/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 ."}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/14/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/14/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/14/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the leader connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/14/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/14/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/14/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/14/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data.", "signature": "-s --schema-only", "source_url": "/docs/14/app-pgdump.html", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/14/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/14/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/14/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/14/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/14/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/14/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "signature": "-Z 0..9 --compress= 0..9", "source_url": "/docs/14/app-pgdump.html", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/14/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/14/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/14/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/14/app-pgdump.html", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/14/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/14/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/14/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/14/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/14/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/14/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/14/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/14/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump comments.", "signature": "--no-comments", "source_url": "/docs/14/app-pgdump.html", "description": "Do not dump comments."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/14/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/14/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/14/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/14/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "signature": "--no-synchronized-snapshots", "source_url": "/docs/14/app-pgdump.html", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/14/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "signature": "--no-toast-compression", "source_url": "/docs/14/app-pgdump.html", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/14/app-pgdump.html", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/14/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/14/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/14/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/14/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/14/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/14/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.90 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/14/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.90 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/14/app-pgdump.html", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/14/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/14/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/14/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/14/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/14/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/14/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/14/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/14/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/14/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=14", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "label": "14.24", "major": "14", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/14/postgresql-14-A4.pdf", "bytes": 14354704, "pages": 2944, "sha256": "8bc6b9dd7b246888bb77f0a5e8c39a2eae52e9926569832669c7d1600becb27c", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/14/postgresql-14-US.pdf", "bytes": 14242178, "pages": 3102, "sha256": "b7ecb5a5f62d8b9f73a69e25a7d26ba285373bc53168a553bff7b77955506db4", "built_at": "2026-09-26"}}, "tree": "14", "index": "index.html", "major": "14", "pages": 1158, "release": "14.24", "source_url": "https://ftp.postgresql.org/pub/source/v14.24/postgresql-14.24.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}, "revision": "588700d46356d8837c77c7c0a4e71e645fe6535983b8f1830aa8f2e4e41c40ae", "evidence_kind": "English manual and source declarations", "source_sha256": "a7fa7ed3d558172355f51406097a7bd4f6b473be80f311ef7cda96bf383d8897"}, "sources": [{"url": "https://pg.center/docs/14/app-pgdump.html", "file": "app-pgdump.html", "label": "14.24 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "3f03c57d602decd44b16a5c47cd6e85f9fa855c4f29b8e27316d0d525d1aef1c", "language": "en", "original_url": "/docs/14/app-pgdump.html"}, {"url": "https://pg.center/docs/14/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "5a13567a052954dfe494dfaab9f50919faa1ae56023930fdbb78d45e53feccde", "language": "en", "original_url": "/docs/14/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06\u4e00\u4e2a PostgreSQL \u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_dump</span></span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06\u4e00\u4e2a<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.13.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u662f\u4e00\u4e2a\u7528\u4e8e\u5907\u4efd<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5907\u4efd\u3002<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5907\u4efd\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5907\u4efd\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/14/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/14/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/14/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5907\u4efd\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86<code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u6216<code class=\"option\">--schema-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code>\u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528<code class=\"option\">--data-only</code>\u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528<code class=\"option\">--schema-only</code>\u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u4e0e<em class=\"replaceable\"><code>pattern</code></em>\u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a<code class=\"option\">-e</code>\u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002</p>\n<p lang=\"zh\">\u7531 <code class=\"function\">pg_extension_config_dump</code> \u6ce8\u518c\u7684\u4efb\u4f55\u914d\u7f6e\u5173\u7cfb\uff0c\u5982\u679c\u5176\u6240\u5c5e\u6269\u5c55\u7531 <code class=\"option\">--extension</code> \u6307\u5b9a\uff0c\u4e5f\u4f1a\u5305\u542b\u5728\u8f6c\u50a8\u4e2d\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a<code class=\"option\">-e</code>\u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6269\u5c55\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6269\u5c55\u7684\u8f6c\u50a8\u7ed3\u679c\u53ef\u4ee5\u6210\u529f\u5730\u5355\u72ec\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728<a class=\"xref\" href=\"/docs/14/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" title=\"24.3.1.\u00a0\u652f\u6301\u7684\u5b57\u7b26\u96c6\">\u7b2c\u00a024.3.1\u00a0\u8282</a>\u4e2d\u63cf\u8ff0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/14/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u9886\u5bfc\u8005\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff08<a class=\"link\" href=\"/docs/14/explicit-locking.html#LOCKING-TABLES\" title=\"13.3.1.\u00a0\u8868\u7ea7\u9501\">ACCESS SHARE</a>\uff09\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u9886\u5bfc\u8005\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u83b7\u5f97\u4e00\u81f4\u7684\u5907\u4efd\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u9886\u5bfc\u8005\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u8981\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u5fc5\u987b\u786e\u4fdd\u4ece\u4e3b\u63a7\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u5230\u6700\u540e\u4e00\u4e2a\u5de5\u4f5c\u4efb\u52a1\u8fde\u63a5\u6570\u636e\u5e93\u8fd9\u6bb5\u65f6\u95f4\u5185\uff0c\u6570\u636e\u5e93\u5185\u5bb9\u4e0d\u53d1\u751f\u53d8\u5316\u3002\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u5728\u5f00\u59cb\u5907\u4efd\u4e4b\u524d\uff0c\u505c\u6b62\u6240\u6709\u8bbf\u95ee\u8be5\u6570\u636e\u5e93\u5e76\u4fee\u6539\u6570\u636e\u7684\u8fdb\u7a0b\uff08DDL \u548c DML\uff09\u3002\u5bf9 9.2 \u4e4b\u524d\u7684 PostgreSQL \u670d\u52a1\u5668\u8fd0\u884c pg_dump -j \u65f6\uff0c\u8fd8\u5fc5\u987b\u6307\u5b9a --no-synchronized-snapshots \u53c2\u6570\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/14/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--blobs</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0e<code class=\"option\">--data-only</code>\u7684\u4f5c\u7528\u76f8\u53cd\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a<code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u7531\u4e8e\u5386\u53f2\u539f\u56e0\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/14/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>0..9</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>0..9</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9<span class=\"application\">gzip</span>\u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/14/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/14/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u9605<code class=\"option\">--schema-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/14/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-synchronized-snapshots</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u5141\u8bb8\u5bf9 9.2 \u4e4b\u524d\u7684\u670d\u52a1\u5668\u8fd0\u884c<code class=\"command\">pg_dump -j</code>\uff0c\u66f4\u591a\u8be6\u60c5\u8bf7\u53c2\u9605<code class=\"option\">-j</code>\u53c2\u6570\u7684\u6587\u6863\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-toast-compression</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e <acronym class=\"acronym\">TOAST</acronym> \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u53ea\u4f1a\u6291\u5236\u8868\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">data \u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u548c\u5e8f\u5217\u503c\u3002post-data \u90e8\u5206\u5305\u542b\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u542b\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/14/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/14/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.90.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.90</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/14/logicaldecoding.html\" title=\"\u7b2c\u00a049\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a049\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08<code class=\"option\">-e</code>/<code class=\"option\">--extension</code>\uff09\u3001\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u9650\u5b9a\u6761\u4ef6\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48\u5373\u4f7f\u4e0d\u4f7f\u7528<code class=\"option\">--strict-names</code>\uff0c<span class=\"application\">pg_dump</span>\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u5f71\u54cd<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code>\u6216<code class=\"option\">--exclude-table-data</code>\u3002\u6392\u9664\u6a21\u5f0f\u672a\u5339\u914d\u5230\u4efb\u4f55\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/14/libpq.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.13.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/14/libpq-envars.html\" title=\"34.15.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a034.15\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/14/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7edf\u8ba1\u6536\u96c6\u5668\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4ec5\u6570\u636e\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e0d\u5305\u542b\u4f18\u5316\u5668\u7528\u4e8e\u51b3\u5b9a\u67e5\u8be2\u8ba1\u5212\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\uff0c\u6700\u597d\u8fd0\u884c<code class=\"command\">ANALYZE</code>\u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff1b\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/14/maintenance.html#VACUUM-FOR-STATISTICS\" title=\"25.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a025.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/14/maintenance.html#AUTOVACUUM\" title=\"25.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a025.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 8.0 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u628a\u6570\u636e\u5e93 <code class=\"literal\">mydb</code> \u8f6c\u50a8\u5230\u4e00\u4e2a SQL \u811a\u672c\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\u6307\u5b9a\u5927\u5199\u6216\u5927\u5c0f\u5199\u6df7\u5408\u7684\u540d\u79f0\uff0c\u5fc5\u987b\u7528\u53cc\u5f15\u53f7\u62ec\u8d77\u8be5\u540d\u79f0\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u4e3a\u5c0f\u5199\uff08\u53c2\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/14/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u4e5f\u6709\u7279\u6b8a\u542b\u4e49\uff0c\u56e0\u6b64\u8fd8\u9700\u8981\u5c06\u53cc\u5f15\u53f7\u672c\u8eab\u7528\u5f15\u53f7\u62ec\u8d77\u3002\u6240\u4ee5\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u79f0\u5927\u5c0f\u5199\u6df7\u5408\u7684\u8868\uff0c\u9700\u8981\u4f7f\u7528\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.13.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/14/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/14/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/14/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/14/app-pgdump.html", "method": "same-major semantic node", "sha256": "506df106577336342accd8cfba88f75a8eaff3227775f79b5b538fa6bef0ebf1", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/14/description/0": "pg_dump \u2014 extract a PostgreSQL database into a script file or other archive file", "/versions/14/facts/0/label": "Documented executable", "/versions/14/facts/1/label": "Executable version", "/versions/14/facts/2/label": "Reference inventory", "/versions/14/facts/2/value": "Client applications", "/versions/14/facts/3/label": "Option definition groups", "/versions/14/tables/0/title": "Documented options", "/versions/14/tables/1/title": "Environment variables", "/versions/14/related/0/label": "libpq connection parameters", "/versions/14/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "/versions/14/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "/versions/14/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/14/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/14/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/14/tables/0/rows/5/summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "/versions/14/tables/0/rows/6/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 .", "/versions/14/tables/0/rows/7/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/14/tables/0/rows/8/summary": "Selects the format of the output. format can be one of the following:", "/versions/14/tables/0/rows/9/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/14/tables/0/columns/0/label": "Option and arguments", "/versions/14/tables/0/columns/1/label": "Description", "/versions/14/tables/0/rows/10/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/14/tables/0/rows/11/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/14/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/14/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/14/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data.", "/versions/14/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/14/tables/0/rows/16/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/14/tables/0/rows/17/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/14/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/14/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/14/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/14/tables/0/rows/21/summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "/versions/14/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/14/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/14/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/14/tables/0/rows/25/summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/14/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/14/tables/0/rows/27/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/14/tables/0/rows/28/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/14/tables/0/rows/29/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/14/tables/0/rows/30/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/14/tables/0/rows/31/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/14/tables/0/rows/32/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/14/tables/0/rows/33/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/14/tables/0/rows/34/summary": "Do not dump comments.", "/versions/14/tables/0/rows/35/summary": "Do not dump publications.", "/versions/14/tables/0/rows/36/summary": "Do not dump security labels.", "/versions/14/tables/0/rows/37/summary": "Do not dump subscriptions.", "/versions/14/tables/0/rows/38/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/14/tables/0/rows/39/summary": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details.", "/versions/14/tables/0/rows/40/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/14/tables/0/rows/41/summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "/versions/14/tables/0/rows/42/summary": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server.", "/versions/14/tables/0/rows/43/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/14/tables/0/rows/44/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/14/tables/0/rows/45/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/14/tables/0/rows/46/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/14/tables/0/rows/47/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/14/tables/0/rows/48/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/14/tables/0/rows/49/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.90 for more details).", "/versions/14/tables/0/rows/50/summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "/versions/14/tables/0/rows/51/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/14/tables/0/rows/52/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/14/tables/0/rows/53/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/14/tables/0/rows/54/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/14/tables/0/rows/55/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/14/tables/0/rows/56/summary": "User name to connect as.", "/versions/14/tables/0/rows/57/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/14/tables/0/rows/58/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/14/tables/0/rows/59/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/14/tables/1/columns/0/label": "Variable", "/versions/14/tables/1/columns/1/label": "Meaning", "/versions/14/tables/1/rows/0/description": "Default connection parameters.", "/versions/14/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "3649038e35a024584131eabc16228b7ed6c42362b4368546c317e657fda7ea2b"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "signature": "-b --blobs", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "signature": "-B --no-blobs", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "signature": "-e pattern --extension= pattern", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 ."}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. For a consistent backup, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup. If you want to run a parallel dump of a pre-9.2 server, you need to make sure that the database content doesn't change from between the time the leader connects to the database until the last worker job has connected to the database. The easiest way to do this is to halt any data modifying processes (DDL and DML) accessing the database before starting the backup. You also need to specify the --no-synchronized-snapshots parameter when running pg_dump -j against a pre-9.2 PostgreSQL server."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "signature": "-Z 0..9 --compress= 0..9", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump comments."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-synchronized-snapshots"], "signature": "--no-synchronized-snapshots", "description": "This option allows running pg_dump -j against a pre-9.2 server, see the documentation of the -j parameter for more details."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "signature": "--no-toast-compression", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables. This option has no effect on whether or not the table definitions (schema) are dumped; it only suppresses dumping the table data. Data in unlogged tables is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.90 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "45402b861aabadbe6c7d717cb48ba9e56b8f45fdfe79a138e52d5ad874572045", "manual_language": "zh"}, "15": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "15.19"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "60"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u6216 --schema-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-b --blobs"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-B --no-blobs"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u4ec5\u8f6c\u50a8\u4e0e pattern \u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -e \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-e pattern --extension= pattern"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728 \u7b2c 24.3.1 \u8282 \u4e2d\u63cf\u8ff0\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9 gzip \u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-Z 0..9 --compress= 0..9"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4\uff08 INSERT INTO table ( column , ...) VALUES ... \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-table-access-method"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e TOAST \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-toast-compression"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.92 \uff09\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08 -e / --extension \uff09\u3001\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u9650\u5b9a\u6761\u4ef6\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48\u5373\u4f7f\u4e0d\u4f7f\u7528 --strict-names \uff0c pg_dump \u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/15/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/15/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "signature": "-b --blobs", "source_url": "/docs/15/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-blobs", "source_url": "/docs/15/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/15/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/15/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "signature": "-e pattern --extension= pattern", "source_url": "/docs/15/app-pgdump.html", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 .", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/15/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 ."}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/15/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/15/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/15/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/15/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/15/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/15/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/15/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data.", "signature": "-s --schema-only", "source_url": "/docs/15/app-pgdump.html", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/15/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/15/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/15/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/15/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/15/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/15/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "signature": "-Z 0..9 --compress= 0..9", "source_url": "/docs/15/app-pgdump.html", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/15/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/15/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/15/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/15/app-pgdump.html", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/15/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/15/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/15/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/15/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/15/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/15/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/15/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/15/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump comments.", "signature": "--no-comments", "source_url": "/docs/15/app-pgdump.html", "description": "Do not dump comments."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/15/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/15/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/15/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/15/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "signature": "--no-table-access-method", "source_url": "/docs/15/app-pgdump.html", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/15/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "signature": "--no-toast-compression", "source_url": "/docs/15/app-pgdump.html", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/15/app-pgdump.html", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/15/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/15/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/15/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/15/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/15/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/15/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.92 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/15/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.92 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/15/app-pgdump.html", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/15/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/15/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/15/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/15/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/15/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/15/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/15/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/15/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/15/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=15", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "label": "15.19", "major": "15", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/15/postgresql-15-A4.pdf", "bytes": 14609140, "pages": 2987, "sha256": "66228564a4d16efb47d6a914085716ecfe22ca1566db56bc7c3d82f790646d72", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/15/postgresql-15-US.pdf", "bytes": 14495690, "pages": 3153, "sha256": "645a498c2390d47a6223ec74770631185807a19c484edb0fc5a295d9f460bc02", "built_at": "2026-09-26"}}, "tree": "15", "index": "index.html", "major": "15", "pages": 1168, "release": "15.19", "source_url": "https://ftp.postgresql.org/pub/source/v15.19/postgresql-15.19.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}, "revision": "6af958c6520151fc7697d56e0616b03fb00522c4568158674d452ae0644ba545", "evidence_kind": "English manual and source declarations", "source_sha256": "e1a64a87a46b825b88c082e4518161a47aab53c45694964f8ba1df28f7859f89"}, "sources": [{"url": "https://pg.center/docs/15/app-pgdump.html", "file": "app-pgdump.html", "label": "15.19 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "682e561faf72da2e4719707ed56c534bca0cbe42d737f7cb9753e59d43be70d4", "language": "en", "original_url": "/docs/15/app-pgdump.html"}, {"url": "https://pg.center/docs/15/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "015b2ea2bd205946a55a1b837e735570631bac831c92074a6bf58444f9a3cb98", "language": "en", "original_url": "/docs/15/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06\u4e00\u4e2a PostgreSQL \u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_dump</span></span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06\u4e00\u4e2a<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.13.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u662f\u4e00\u4e2a\u7528\u4e8e\u5907\u4efd<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5907\u4efd\u3002<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5907\u4efd\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5907\u4efd\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/15/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/15/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/15/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5907\u4efd\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86<code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u6216<code class=\"option\">--schema-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code>\u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528<code class=\"option\">--data-only</code>\u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528<code class=\"option\">--schema-only</code>\u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u4e0e<em class=\"replaceable\"><code>pattern</code></em>\u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a<code class=\"option\">-e</code>\u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002</p>\n<p lang=\"zh\">\u7531 <code class=\"function\">pg_extension_config_dump</code> \u6ce8\u518c\u7684\u4efb\u4f55\u914d\u7f6e\u5173\u7cfb\uff0c\u5982\u679c\u5176\u6240\u5c5e\u6269\u5c55\u7531 <code class=\"option\">--extension</code> \u6307\u5b9a\uff0c\u4e5f\u4f1a\u5305\u542b\u5728\u8f6c\u50a8\u4e2d\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a<code class=\"option\">-e</code>\u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6269\u5c55\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6269\u5c55\u7684\u8f6c\u50a8\u7ed3\u679c\u53ef\u4ee5\u6210\u529f\u5730\u5355\u72ec\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728<a class=\"xref\" href=\"/docs/15/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" title=\"24.3.1.\u00a0\u652f\u6301\u7684\u5b57\u7b26\u96c6\">\u7b2c\u00a024.3.1\u00a0\u8282</a>\u4e2d\u63cf\u8ff0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/15/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u9886\u5bfc\u8005\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff08<a class=\"link\" href=\"/docs/15/explicit-locking.html#LOCKING-TABLES\" title=\"13.3.1.\u00a0\u8868\u7ea7\u9501\">ACCESS SHARE</a>\uff09\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u9886\u5bfc\u8005\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u9886\u5bfc\u8005\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/15/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--blobs</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0e<code class=\"option\">--data-only</code>\u7684\u4f5c\u7528\u76f8\u53cd\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a<code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u7531\u4e8e\u5386\u53f2\u539f\u56e0\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/15/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>0..9</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>0..9</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6240\u7528\u7684\u538b\u7f29\u7ea7\u522b\u3002\u96f6\u8868\u793a\u4e0d\u538b\u7f29\u3002\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u683c\u5f0f\u548c\u76ee\u5f55\u683c\u5f0f\u5f52\u6863\uff0c\u8be5\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u4ee5\u9002\u4e2d\u7684\u7ea7\u522b\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u538b\u7f29\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\uff0c\u5c31\u50cf\u5c06\u5176\u4f20\u7ed9<span class=\"application\">gzip</span>\u5904\u7406\u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u4e0d\u538b\u7f29\u3002tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/15/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/15/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u9605<code class=\"option\">--schema-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/15/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-table-access-method</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-toast-compression</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e <acronym class=\"acronym\">TOAST</acronym> \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">data \u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u548c\u5e8f\u5217\u503c\u3002post-data \u90e8\u5206\u5305\u542b\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u542b\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/15/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/15/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.92.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.92</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/15/logicaldecoding.html\" title=\"\u7b2c\u00a049\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a049\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08<code class=\"option\">-e</code>/<code class=\"option\">--extension</code>\uff09\u3001\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u9650\u5b9a\u6761\u4ef6\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u9650\u5b9a\u6761\u4ef6\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48\u5373\u4f7f\u4e0d\u4f7f\u7528<code class=\"option\">--strict-names</code>\uff0c<span class=\"application\">pg_dump</span>\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u5f71\u54cd<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code>\u6216<code class=\"option\">--exclude-table-data</code>\u3002\u6392\u9664\u6a21\u5f0f\u672a\u5339\u914d\u5230\u4efb\u4f55\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/15/libpq.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.13.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/15/libpq-envars.html\" title=\"34.15.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a034.15\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/15/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4ec5\u6570\u636e\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e0d\u5305\u542b\u4f18\u5316\u5668\u7528\u4e8e\u51b3\u5b9a\u67e5\u8be2\u8ba1\u5212\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\uff0c\u6700\u597d\u8fd0\u884c<code class=\"command\">ANALYZE</code>\u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff1b\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/15/maintenance.html#VACUUM-FOR-STATISTICS\" title=\"25.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a025.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/15/maintenance.html#AUTOVACUUM\" title=\"25.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a025.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 9.2 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002\u5982\u679c\u7528\u6237\u6253\u7b97\u5728\u5237\u65b0\u671f\u95f4\u590d\u5236\u521d\u59cb\u6570\u636e\uff0c\u5219\u5fc5\u987b\u4ee5 <code class=\"literal\">two_phase = false</code> \u521b\u5efa\u8be5\u69fd\u3002\u521d\u59cb\u540c\u6b65\u4e4b\u540e\uff0c\u8ba2\u9605\u8005\u4f1a\u81ea\u52a8\u542f\u7528 <code class=\"literal\">two_phase</code> \u9009\u9879\uff0c\u524d\u63d0\u662f\u8be5\u8ba2\u9605\u6700\u521d\u662f\u4ee5 <code class=\"literal\">two_phase = true</code> \u9009\u9879\u521b\u5efa\u7684\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u628a\u6570\u636e\u5e93 <code class=\"literal\">mydb</code> \u8f6c\u50a8\u5230\u4e00\u4e2a SQL \u811a\u672c\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\u6307\u5b9a\u5927\u5199\u6216\u5927\u5c0f\u5199\u6df7\u5408\u7684\u540d\u79f0\uff0c\u5fc5\u987b\u7528\u53cc\u5f15\u53f7\u62ec\u8d77\u8be5\u540d\u79f0\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u4e3a\u5c0f\u5199\uff08\u53c2\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/15/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u4e5f\u6709\u7279\u6b8a\u542b\u4e49\uff0c\u56e0\u6b64\u8fd8\u9700\u8981\u5c06\u53cc\u5f15\u53f7\u672c\u8eab\u7528\u5f15\u53f7\u62ec\u8d77\u3002\u6240\u4ee5\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u79f0\u5927\u5c0f\u5199\u6df7\u5408\u7684\u8868\uff0c\u9700\u8981\u4f7f\u7528\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.13.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/15/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/15/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/15/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/15/app-pgdump.html", "method": "same-major semantic node", "sha256": "2c7bf3a817e06823661e1d45c90d1677fa32826fbe116ee625f518af1be26e5c", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/15/description/0": "pg_dump \u2014 extract a PostgreSQL database into a script file or other archive file", "/versions/15/facts/0/label": "Documented executable", "/versions/15/facts/1/label": "Executable version", "/versions/15/facts/2/label": "Reference inventory", "/versions/15/facts/2/value": "Client applications", "/versions/15/facts/3/label": "Option definition groups", "/versions/15/tables/0/title": "Documented options", "/versions/15/tables/1/title": "Environment variables", "/versions/15/related/0/label": "libpq connection parameters", "/versions/15/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "/versions/15/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "/versions/15/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/15/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/15/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/15/tables/0/rows/5/summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "/versions/15/tables/0/rows/6/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 .", "/versions/15/tables/0/rows/7/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/15/tables/0/rows/8/summary": "Selects the format of the output. format can be one of the following:", "/versions/15/tables/0/rows/9/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/15/tables/0/columns/0/label": "Option and arguments", "/versions/15/tables/0/columns/1/label": "Description", "/versions/15/tables/0/rows/10/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/15/tables/0/rows/11/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/15/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/15/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/15/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data.", "/versions/15/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/15/tables/0/rows/16/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/15/tables/0/rows/17/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/15/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/15/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/15/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/15/tables/0/rows/21/summary": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all.", "/versions/15/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/15/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/15/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/15/tables/0/rows/25/summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/15/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/15/tables/0/rows/27/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/15/tables/0/rows/28/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/15/tables/0/rows/29/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/15/tables/0/rows/30/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/15/tables/0/rows/31/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/15/tables/0/rows/32/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/15/tables/0/rows/33/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/15/tables/0/rows/34/summary": "Do not dump comments.", "/versions/15/tables/0/rows/35/summary": "Do not dump publications.", "/versions/15/tables/0/rows/36/summary": "Do not dump security labels.", "/versions/15/tables/0/rows/37/summary": "Do not dump subscriptions.", "/versions/15/tables/0/rows/38/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/15/tables/0/rows/39/summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "/versions/15/tables/0/rows/40/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/15/tables/0/rows/41/summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "/versions/15/tables/0/rows/42/summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "/versions/15/tables/0/rows/43/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/15/tables/0/rows/44/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/15/tables/0/rows/45/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/15/tables/0/rows/46/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/15/tables/0/rows/47/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/15/tables/0/rows/48/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/15/tables/0/rows/49/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.92 for more details).", "/versions/15/tables/0/rows/50/summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names .", "/versions/15/tables/0/rows/51/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/15/tables/0/rows/52/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/15/tables/0/rows/53/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/15/tables/0/rows/54/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/15/tables/0/rows/55/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/15/tables/0/rows/56/summary": "User name to connect as.", "/versions/15/tables/0/rows/57/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/15/tables/0/rows/58/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/15/tables/0/rows/59/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/15/tables/1/columns/0/label": "Variable", "/versions/15/tables/1/columns/1/label": "Meaning", "/versions/15/tables/1/rows/0/description": "Default connection parameters.", "/versions/15/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "e14d0053ff70811f5f42b3f8154215700584a13345ee6ad0b53bc998e1a5ff07"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--blobs"], "signature": "-b --blobs", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that blobs are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-blobs"], "signature": "-B --no-blobs", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "signature": "-e pattern --extension= pattern", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 ."}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and blob being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip tool. This format is compressed by default and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z 0..9", "--compress= 0..9"], "signature": "-Z 0..9 --compress= 0..9", "description": "Specify the compression level to use. Zero means no compression. For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip ; but the default is not to compress. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns below), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump comments."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "signature": "--no-table-access-method", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "signature": "--no-toast-compression", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.92 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) qualifier match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table qualifiers find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "145309a8b8c908fe8e0b8a82daabf0ff7f2e4fb87ec12c38bf9d24855493d782", "manual_language": "zh"}, "16": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "16.15"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "63"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u6216 --schema-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-b --large-objects --blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-B --no-large-objects --no-blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u4ec5\u8f6c\u50a8\u4e0e pattern \u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -e \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-e pattern --extension= pattern"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728 \u7b2c 24.3.1 \u8282 \u4e2d\u63cf\u8ff0\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a gzip \u3001 lz4 \u3001 zstd \u6216 none \uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 keyword \u6216 keyword=value \u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f level \u548c long \u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4\uff08 INSERT INTO table ( column , ...) VALUES ... \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u8fd9\u4e0e -T / --exclude-table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--exclude-table-and-children= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u8fd9\u4e0e --exclude-table-data \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--exclude-table-data-and-children= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-table-access-method"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e TOAST \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-toast-compression"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.94 \uff09\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08 -e / --extension \uff09\u3001\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u5339\u914d\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u5339\u914d\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48\u5373\u4f7f\u4e0d\u4f7f\u7528 --strict-names \uff0c pg_dump \u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u8fd9\u4e0e -t / --table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--table-and-children= pattern"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/16/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/16/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "signature": "-b --large-objects --blobs (deprecated)", "source_url": "/docs/16/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-large-objects --no-blobs (deprecated)", "source_url": "/docs/16/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/16/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/16/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "signature": "-e pattern --extension= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 .", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/16/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 ."}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/16/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/16/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/16/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/16/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/16/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data.", "signature": "-s --schema-only", "source_url": "/docs/16/app-pgdump.html", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/16/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/16/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/16/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/16/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "source_url": "/docs/16/app-pgdump.html", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/16/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/16/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/16/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/16/app-pgdump.html", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/16/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-and-children= pattern"], "summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-and-children= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-data-and-children= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/16/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/16/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/16/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/16/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/16/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/16/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump comments.", "signature": "--no-comments", "source_url": "/docs/16/app-pgdump.html", "description": "Do not dump comments."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/16/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/16/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/16/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/16/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "signature": "--no-table-access-method", "source_url": "/docs/16/app-pgdump.html", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/16/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "signature": "--no-toast-compression", "source_url": "/docs/16/app-pgdump.html", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/16/app-pgdump.html", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/16/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/16/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/16/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/16/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/16/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/16/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.94 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/16/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.94 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/16/app-pgdump.html", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--table-and-children= pattern"], "summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--table-and-children= pattern", "source_url": "/docs/16/app-pgdump.html", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/16/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/16/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/16/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/16/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/16/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/16/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/16/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/16/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/16/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=16", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "label": "16.15", "major": "16", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/16/postgresql-16-A4.pdf", "bytes": 15282337, "pages": 3055, "sha256": "4bb6c1f63deedac98736d8c4c7bc0fad0ac24e85b07e21ee10411872f06afd06", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/16/postgresql-16-US.pdf", "bytes": 15164148, "pages": 3220, "sha256": "5b6b6166c89991199e144bb0ae34c17a5f29826251dbf19db1abc0df3a3e771b", "built_at": "2026-09-26"}}, "tree": "16", "index": "index.html", "major": "16", "pages": 1169, "release": "16.15", "source_url": "https://ftp.postgresql.org/pub/source/v16.15/postgresql-16.15.tar.bz2", "svg_assets": 3, "source_mode": "en HTML verified against the pinned official archive", "source_sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}, "revision": "3c21e58b35318021716440e67bb8bafd392b6a2b965a244d90e9e33c99e0bdef", "evidence_kind": "English manual and source declarations", "source_sha256": "c1575341fa7bd40f5274ea465b34390f4dc64cdd0770af327005caaeb9f6b7ed"}, "sources": [{"url": "https://pg.center/docs/16/app-pgdump.html", "file": "app-pgdump.html", "label": "16.15 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "2a071adab15b4a16ee7707c6f1f321b22d5103535532b4c08fa0eb276af65f55", "language": "en", "original_url": "/docs/16/app-pgdump.html"}, {"url": "https://pg.center/docs/16/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "a28c30c3c0f8783e16d56413a0b6fd39487e336da1683b29b60abf1c229cef26", "language": "en", "original_url": "/docs/16/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06\u4e00\u4e2a PostgreSQL \u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_dump</span></span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06\u4e00\u4e2a<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.13.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u662f\u4e00\u4e2a\u7528\u4e8e\u5907\u4efd<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5907\u4efd\u3002<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5907\u4efd\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5907\u4efd\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/16/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/16/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/16/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5907\u4efd\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86<code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u6216<code class=\"option\">--schema-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code>\u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528<code class=\"option\">--data-only</code>\u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528<code class=\"option\">--schema-only</code>\u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u4e0e<em class=\"replaceable\"><code>pattern</code></em>\u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a<code class=\"option\">-e</code>\u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002</p>\n<p lang=\"zh\">\u7531 <code class=\"function\">pg_extension_config_dump</code> \u6ce8\u518c\u7684\u4efb\u4f55\u914d\u7f6e\u5173\u7cfb\uff0c\u5982\u679c\u5176\u6240\u5c5e\u6269\u5c55\u7531 <code class=\"option\">--extension</code> \u6307\u5b9a\uff0c\u4e5f\u4f1a\u5305\u542b\u5728\u8f6c\u50a8\u4e2d\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a<code class=\"option\">-e</code>\u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6269\u5c55\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6269\u5c55\u7684\u8f6c\u50a8\u7ed3\u679c\u53ef\u4ee5\u6210\u529f\u5730\u5355\u72ec\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728<a class=\"xref\" href=\"/docs/16/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" title=\"24.3.1.\u00a0\u652f\u6301\u7684\u5b57\u7b26\u96c6\">\u7b2c\u00a024.3.1\u00a0\u8282</a>\u4e2d\u63cf\u8ff0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u4f7f\u7528 <code class=\"literal\">gzip</code> \u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/16/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u9886\u5bfc\u8005\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff08<a class=\"link\" href=\"/docs/16/explicit-locking.html#LOCKING-TABLES\" title=\"13.3.1.\u00a0\u8868\u7ea7\u9501\">ACCESS SHARE</a>\uff09\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u9886\u5bfc\u8005\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u9886\u5bfc\u8005\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/16/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--large-objects</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0e<code class=\"option\">--data-only</code>\u7684\u4f5c\u7528\u76f8\u53cd\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a<code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u7531\u4e8e\u5386\u53f2\u539f\u56e0\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/16/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]<br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]</span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a <code class=\"literal\">gzip</code>\u3001<code class=\"literal\">lz4</code>\u3001<code class=\"literal\">zstd</code> \u6216 <code class=\"literal\">none</code>\uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 <code class=\"literal\">keyword</code> \u6216 <code class=\"literal\">keyword=value</code>\u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f <code class=\"literal\">level</code> \u548c <code class=\"literal\">long</code>\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u672a\u6307\u5b9a\u538b\u7f29\u7ea7\u522b\uff0c\u5c06\u4f7f\u7528\u9ed8\u8ba4\u7ea7\u522b\u3002\u5982\u679c\u53ea\u6307\u5b9a\u7ea7\u522b\u800c\u672a\u6307\u5b9a\u7b97\u6cd5\uff0c\u5219\u7ea7\u522b\u5927\u4e8e 0 \u65f6\u4f7f\u7528 gzip \u538b\u7f29\uff0c\u7ea7\u522b\u4e3a 0 \u65f6\u4e0d\u538b\u7f29\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e custom \u548c directory \u5f52\u6863\u683c\u5f0f\uff0c\u6b64\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u662f\u4f7f\u7528\u4e2d\u7b49\u7ea7\u522b\u7684 <code class=\"literal\">gzip</code> \u8fdb\u884c\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\u88ab\u538b\u7f29\uff0c\u5c31\u50cf\u5b83\u7ecf\u8fc7\u4e86 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u662f\u4e0d\u538b\u7f29\u3002\u4f7f\u7528 zstd \u538b\u7f29\u65f6\uff0c<code class=\"literal\">long</code> \u6a21\u5f0f\u53ef\u80fd\u63d0\u9ad8\u538b\u7f29\u6bd4\uff0c\u4f46\u4ee3\u4ef7\u662f\u5185\u5b58\u4f7f\u7528\u589e\u52a0\u3002</p>\n<p lang=\"zh\">tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/16/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/16/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u9605<code class=\"option\">--schema-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/16/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-table-access-method</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-toast-compression</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e <acronym class=\"acronym\">TOAST</acronym> \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">data \u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u548c\u5e8f\u5217\u503c\u3002post-data \u90e8\u5206\u5305\u542b\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u542b\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/16/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/16/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.94.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.94</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/16/logicaldecoding.html\" title=\"\u7b2c\u00a049\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a049\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08<code class=\"option\">-e</code>/<code class=\"option\">--extension</code>\uff09\u3001\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u5339\u914d\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u5339\u914d\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48\u5373\u4f7f\u4e0d\u4f7f\u7528<code class=\"option\">--strict-names</code>\uff0c<span class=\"application\">pg_dump</span>\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u5f71\u54cd<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code>\u6216<code class=\"option\">--exclude-table-data</code>\u3002\u6392\u9664\u6a21\u5f0f\u672a\u5339\u914d\u5230\u4efb\u4f55\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/16/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"34.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.13.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/16/libpq-envars.html\" title=\"34.15.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a034.15\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/16/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4ec5\u6570\u636e\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e0d\u5305\u542b\u4f18\u5316\u5668\u7528\u4e8e\u51b3\u5b9a\u67e5\u8be2\u8ba1\u5212\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\uff0c\u6700\u597d\u8fd0\u884c<code class=\"command\">ANALYZE</code>\u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff1b\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/16/routine-vacuuming.html#VACUUM-FOR-STATISTICS\" title=\"25.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a025.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/16/routine-vacuuming.html#AUTOVACUUM\" title=\"25.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a025.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 9.2 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002\u5982\u679c\u7528\u6237\u6253\u7b97\u5728\u5237\u65b0\u671f\u95f4\u590d\u5236\u521d\u59cb\u6570\u636e\uff0c\u5219\u5fc5\u987b\u4ee5 <code class=\"literal\">two_phase = false</code> \u521b\u5efa\u8be5\u69fd\u3002\u521d\u59cb\u540c\u6b65\u4e4b\u540e\uff0c\u8ba2\u9605\u8005\u4f1a\u81ea\u52a8\u542f\u7528 <a class=\"link\" href=\"/docs/16/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\uff0c\u524d\u63d0\u662f\u8be5\u8ba2\u9605\u6700\u521d\u662f\u4ee5 <code class=\"literal\">two_phase = true</code> \u9009\u9879\u521b\u5efa\u7684\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u628a\u6570\u636e\u5e93 <code class=\"literal\">mydb</code> \u8f6c\u50a8\u5230\u4e00\u4e2a SQL \u811a\u672c\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\uff0c\u5982\u679c\u8981\u6307\u5b9a\u4e00\u4e2a\u5927\u5199\u6216\u6df7\u5408\u5927\u5c0f\u5199\u7684\u540d\u79f0\uff0c\u5c31\u9700\u8981\u5bf9\u8be5\u540d\u79f0\u52a0\u53cc\u5f15\u53f7\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u6210\u5c0f\u5199\uff08\u89c1<a class=\"xref\" href=\"/docs/16/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6765\u8bf4\u53c8\u662f\u7279\u6b8a\u5b57\u7b26\uff0c\u56e0\u6b64\u53cd\u8fc7\u6765\u8fd8\u5fc5\u987b\u518d\u88ab\u5f15\u7528\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u5177\u6709\u6df7\u5408\u5927\u5c0f\u5199\u540d\u79f0\u7684\u5355\u4e2a\u8868\uff0c\u9700\u8981\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.13.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/16/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/16/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/16/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/16/app-pgdump.html", "method": "same-major semantic node", "sha256": "21cce810d4a2d1b01ff931774d2a74fc27839be4c8813d90a4e19a728b399730", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[111]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[6]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/16/description/0": "pg_dump \u2014 extract a PostgreSQL database into a script file or other archive file", "/versions/16/facts/0/label": "Documented executable", "/versions/16/facts/1/label": "Executable version", "/versions/16/facts/2/label": "Reference inventory", "/versions/16/facts/2/value": "Client applications", "/versions/16/facts/3/label": "Option definition groups", "/versions/16/tables/0/title": "Documented options", "/versions/16/tables/1/title": "Environment variables", "/versions/16/related/0/label": "libpq connection parameters", "/versions/16/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "/versions/16/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "/versions/16/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/16/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/16/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/16/tables/0/rows/5/summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "/versions/16/tables/0/rows/6/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 .", "/versions/16/tables/0/rows/7/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/16/tables/0/rows/8/summary": "Selects the format of the output. format can be one of the following:", "/versions/16/tables/0/rows/9/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/16/tables/0/columns/0/label": "Option and arguments", "/versions/16/tables/0/columns/1/label": "Description", "/versions/16/tables/0/rows/10/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/16/tables/0/rows/11/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/16/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/16/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/16/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data.", "/versions/16/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/16/tables/0/rows/16/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/16/tables/0/rows/17/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/16/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/16/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/16/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/16/tables/0/rows/21/summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "/versions/16/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/16/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/16/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/16/tables/0/rows/25/summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/16/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/16/tables/0/rows/27/summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/16/tables/0/rows/28/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/16/tables/0/rows/29/summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/16/tables/0/rows/30/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/16/tables/0/rows/31/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/16/tables/0/rows/32/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/16/tables/0/rows/33/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/16/tables/0/rows/34/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/16/tables/0/rows/35/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/16/tables/0/rows/36/summary": "Do not dump comments.", "/versions/16/tables/0/rows/37/summary": "Do not dump publications.", "/versions/16/tables/0/rows/38/summary": "Do not dump security labels.", "/versions/16/tables/0/rows/39/summary": "Do not dump subscriptions.", "/versions/16/tables/0/rows/40/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/16/tables/0/rows/41/summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "/versions/16/tables/0/rows/42/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/16/tables/0/rows/43/summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "/versions/16/tables/0/rows/44/summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "/versions/16/tables/0/rows/45/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/16/tables/0/rows/46/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/16/tables/0/rows/47/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/16/tables/0/rows/48/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/16/tables/0/rows/49/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/16/tables/0/rows/50/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/16/tables/0/rows/51/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.94 for more details).", "/versions/16/tables/0/rows/52/summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "/versions/16/tables/0/rows/53/summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/16/tables/0/rows/54/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/16/tables/0/rows/55/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/16/tables/0/rows/56/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/16/tables/0/rows/57/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/16/tables/0/rows/58/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/16/tables/0/rows/59/summary": "User name to connect as.", "/versions/16/tables/0/rows/60/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/16/tables/0/rows/61/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/16/tables/0/rows/62/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/16/tables/1/columns/0/label": "Variable", "/versions/16/tables/1/columns/1/label": "Meaning", "/versions/16/tables/1/rows/0/description": "Default connection parameters.", "/versions/16/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .", "/versions/16/tables/0/rows/1/signature/text": "-b --large-objects --blobs (deprecated)", "/versions/16/tables/0/rows/2/signature/text": "-B --no-large-objects --no-blobs (deprecated)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "1c123b07e74bf8c024ad5da0cd8b78be7a3ab9a5e263531ab0424eab68fa535b"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "signature": "-b --large-objects --blobs (deprecated)", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "signature": "-B --no-large-objects --no-blobs (deprecated)", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "signature": "-e pattern --extension= pattern", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 24.3.1 ."}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-table-and-children= pattern"], "signature": "--exclude-table-and-children= pattern", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "signature": "--exclude-table-data-and-children= pattern", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump comments."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "signature": "--no-table-access-method", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "signature": "--no-toast-compression", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.94 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--table-and-children= pattern"], "signature": "--table-and-children= pattern", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "e6d445c9cc454fe6ecfd7df0014a282e43ce0195b43747c1faf46476099d9b0a", "manual_language": "zh"}, "17": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "17.11"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "66"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u6216 --schema-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-b --large-objects --blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-B --no-large-objects --no-blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u4ec5\u8f6c\u50a8\u4e0e pattern \u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -e \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-e pattern --extension= pattern"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728 \u7b2c 23.3.1 \u8282 \u4e2d\u63cf\u8ff0\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a gzip \u3001 lz4 \u3001 zstd \u6216 none \uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 keyword \u6216 keyword=value \u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f level \u548c long \u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4\uff08 INSERT INTO table ( column , ...) VALUES ... \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -e \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-extension \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--exclude-extension= pattern"}}, {"summary": "\u8fd9\u4e0e -T / --exclude-table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--exclude-table-and-children= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u8fd9\u4e0e --exclude-table-data \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--exclude-table-data-and-children= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 -t / --table \u3001 --table-and-children \u3001 -T / --exclude-table \u548c --exclude-table-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 -n / --schema \u548c -N / --exclude-schema \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 --include-foreign-data \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 --exclude-table-data \u548c --exclude-table-data-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 -e / --extension \u548c --exclude-extension \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece STDIN \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 - \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002 --filter \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--filter= filename"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-table-access-method"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e TOAST \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-toast-compression"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.98 \uff09\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08 -e / --extension \uff09\u3001\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 --filter \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 pg_dump \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 --strict-names \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u5f53\u8bbe\u4e3a fsync \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c pg_dump --format=directory \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--sync-method= method"}}, {"summary": "\u8fd9\u4e0e -t / --table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--table-and-children= pattern"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/17/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/17/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "signature": "-b --large-objects --blobs (deprecated)", "source_url": "/docs/17/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-large-objects --no-blobs (deprecated)", "source_url": "/docs/17/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/17/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/17/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "signature": "-e pattern --extension= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/17/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/17/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/17/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/17/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/17/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/17/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data.", "signature": "-s --schema-only", "source_url": "/docs/17/app-pgdump.html", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/17/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/17/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/17/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/17/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "source_url": "/docs/17/app-pgdump.html", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/17/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/17/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/17/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/17/app-pgdump.html", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/17/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "signature": "--exclude-extension= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-and-children= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-data-and-children= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/17/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "signature": "--filter= filename", "source_url": "/docs/17/app-pgdump.html", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/17/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/17/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/17/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/17/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/17/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump comments.", "signature": "--no-comments", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump comments."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/17/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "signature": "--no-table-access-method", "source_url": "/docs/17/app-pgdump.html", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/17/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "signature": "--no-toast-compression", "source_url": "/docs/17/app-pgdump.html", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/17/app-pgdump.html", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/17/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/17/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/17/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/17/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/17/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/17/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.98 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/17/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.98 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/17/app-pgdump.html", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "signature": "--sync-method= method", "source_url": "/docs/17/app-pgdump.html", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--table-and-children= pattern", "source_url": "/docs/17/app-pgdump.html", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/17/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/17/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/17/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/17/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/17/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/17/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/17/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/17/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/17/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=17", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "label": "17.11", "major": "17", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/17/postgresql-17-A4.pdf", "bytes": 15521293, "pages": 3099, "sha256": "1991354df0dc89e70ec39328c28988ef8b19c6a93671dab3893650b63e9f4e36", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/17/postgresql-17-US.pdf", "bytes": 15398150, "pages": 3270, "sha256": "07696c8f38abf31babf22d2db337093936e7c472d2af36d050b000c49bbcf52c", "built_at": "2026-09-26"}}, "tree": "17", "index": "index.html", "major": "17", "pages": 1143, "release": "17.11", "source_url": "https://ftp.postgresql.org/pub/source/v17.11/postgresql-17.11.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "revision": "58419c9b0dd42cb34c8d53695bb025a7e582edf55ccd4c5bcb1c2c7c71a37487", "evidence_kind": "English manual and source declarations", "source_sha256": "dd27f2b3c59e73ed14aa3324901242bf69a032a6347805f274e6260322d42979"}, "sources": [{"url": "https://pg.center/docs/17/app-pgdump.html", "file": "app-pgdump.html", "label": "17.11 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "20101bf76517a8d9cc585fae2cd3d1d77e8e332aa5d1a1c60e0f8203d41565a4", "language": "en", "original_url": "/docs/17/app-pgdump.html"}, {"url": "https://pg.center/docs/17/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "3194fc72ddad8e2fcba55f8e007f83413cb352146cb65aaa9457a18d0314ee1b", "language": "en", "original_url": "/docs/17/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06\u4e00\u4e2a PostgreSQL \u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_dump</span></span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06\u4e00\u4e2a<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a\u811a\u672c\u6587\u4ef6\u6216\u5176\u4ed6\u5f52\u6863\u6587\u4ef6</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.14.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u662f\u4e00\u4e2a\u7528\u4e8e\u5907\u4efd<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5907\u4efd\u3002<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5907\u4efd\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5907\u4efd\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/17/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/17/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/17/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5907\u4efd\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86<code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u6216<code class=\"option\">--schema-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code>\u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528<code class=\"option\">--data-only</code>\u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528<code class=\"option\">--schema-only</code>\u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u4e0e<em class=\"replaceable\"><code>pattern</code></em>\u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a<code class=\"option\">-e</code>\u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002</p>\n<p lang=\"zh\">\u7531 <code class=\"function\">pg_extension_config_dump</code> \u6ce8\u518c\u7684\u4efb\u4f55\u914d\u7f6e\u5173\u7cfb\uff0c\u5982\u679c\u5176\u6240\u5c5e\u6269\u5c55\u7531 <code class=\"option\">--extension</code> \u6307\u5b9a\uff0c\u4e5f\u4f1a\u5305\u542b\u5728\u8f6c\u50a8\u4e2d\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a<code class=\"option\">-e</code>\u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6269\u5c55\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6269\u5c55\u7684\u8f6c\u50a8\u7ed3\u679c\u53ef\u4ee5\u6210\u529f\u5730\u5355\u72ec\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728<a class=\"xref\" href=\"/docs/17/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" title=\"23.3.1.\u00a0\u652f\u6301\u7684\u5b57\u7b26\u96c6\">\u7b2c\u00a023.3.1\u00a0\u8282</a>\u4e2d\u63cf\u8ff0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u4f7f\u7528 <code class=\"literal\">gzip</code> \u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/17/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u9886\u5bfc\u8005\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff08<a class=\"link\" href=\"/docs/17/explicit-locking.html#LOCKING-TABLES\" title=\"13.3.1.\u00a0\u8868\u7ea7\u9501\">ACCESS SHARE</a>\uff09\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u9886\u5bfc\u8005\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u9886\u5bfc\u8005\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/17/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--large-objects</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0e<code class=\"option\">--data-only</code>\u7684\u4f5c\u7528\u76f8\u53cd\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a<code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u7531\u4e8e\u5386\u53f2\u539f\u56e0\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/17/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]<br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]</span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a <code class=\"literal\">gzip</code>\u3001<code class=\"literal\">lz4</code>\u3001<code class=\"literal\">zstd</code> \u6216 <code class=\"literal\">none</code>\uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 <code class=\"literal\">keyword</code> \u6216 <code class=\"literal\">keyword=value</code>\u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f <code class=\"literal\">level</code> \u548c <code class=\"literal\">long</code>\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u672a\u6307\u5b9a\u538b\u7f29\u7ea7\u522b\uff0c\u5c06\u4f7f\u7528\u9ed8\u8ba4\u7ea7\u522b\u3002\u5982\u679c\u53ea\u6307\u5b9a\u7ea7\u522b\u800c\u672a\u6307\u5b9a\u7b97\u6cd5\uff0c\u5219\u7ea7\u522b\u5927\u4e8e 0 \u65f6\u4f7f\u7528 gzip \u538b\u7f29\uff0c\u7ea7\u522b\u4e3a 0 \u65f6\u4e0d\u538b\u7f29\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e custom \u548c directory \u5f52\u6863\u683c\u5f0f\uff0c\u6b64\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u662f\u4f7f\u7528\u4e2d\u7b49\u7ea7\u522b\u7684 <code class=\"literal\">gzip</code> \u8fdb\u884c\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\u88ab\u538b\u7f29\uff0c\u5c31\u50cf\u5b83\u7ecf\u8fc7\u4e86 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u662f\u4e0d\u538b\u7f29\u3002\u4f7f\u7528 zstd \u538b\u7f29\u65f6\uff0c<code class=\"literal\">long</code> \u6a21\u5f0f\u53ef\u80fd\u63d0\u9ad8\u538b\u7f29\u6bd4\uff0c\u4f46\u4ee3\u4ef7\u662f\u5185\u5b58\u4f7f\u7528\u589e\u52a0\u3002</p>\n<p lang=\"zh\">tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u4ec5\u6570\u636e\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/17/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/17/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-e</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-extension</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-e</code> \u548c <code class=\"option\">--exclude-extension</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-e</code> \u5f00\u5173\u3001\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">--exclude-extension</code> \u5f00\u5173\u7684\u6269\u5c55\u3002\u5982\u679c <code class=\"option\">--exclude-extension</code> \u5728\u6ca1\u6709 <code class=\"option\">-e</code> \u7684\u60c5\u51b5\u4e0b\u51fa\u73b0\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">--exclude-extension</code> \u7684\u6269\u5c55\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u9605<code class=\"option\">--schema-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--filter=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 <code class=\"option\">-t</code>/<code class=\"option\">--table</code>\u3001<code class=\"option\">--table-and-children</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u548c <code class=\"option\">--exclude-table-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u548c <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--exclude-table-data</code> \u548c <code class=\"option\">--exclude-table-data-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u548c <code class=\"option\">--exclude-extension</code> \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece <code class=\"literal\">STDIN</code> \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 <code class=\"filename\">-</code> \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002<code class=\"option\">--filter</code> \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002</p>\n<p lang=\"zh\">\u6587\u4ef6\u6bcf\u884c\u5217\u51fa\u4e00\u4e2a\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a</p>\n<pre class=\"synopsis\">{ include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } <em class=\"replaceable\"><code>PATTERN</code></em>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e00\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u662f\u5305\u542b\u8fd8\u662f\u6392\u9664\u4e0e\u6a21\u5f0f\u5339\u914d\u7684\u5bf9\u8c61\u3002\u7b2c\u4e8c\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u8981\u7528\u8be5\u6a21\u5f0f\u8fc7\u6ee4\u7684\u5bf9\u8c61\u7c7b\u578b\uff1a</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">extension</code>\uff1a\u6269\u5c55\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u6216 <code class=\"option\">--exclude-extension</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">foreign_data</code>\uff1a\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--include-foreign-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">include</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table</code>\uff1a\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u6216 <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_and_children</code>\uff1a\u8868\uff0c\u4ee5\u53ca\u5176\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--table-and-children</code> \u6216 <code class=\"option\">--exclude-table-and-children</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data_and_children</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\uff0c\u4ee5\u53ca\u8fd9\u4e9b\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data-and-children</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">schema</code>\uff1a\u6a21\u5f0f\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u6216 <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u9009\u9879\u3002</p>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u4ee5 <code class=\"literal\">#</code> \u5f00\u5934\u7684\u884c\u88ab\u89c6\u4e3a\u6ce8\u91ca\u5e76\u5ffd\u7565\u3002\u6ce8\u91ca\u4e5f\u53ef\u4ee5\u653e\u5728\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u884c\u4e4b\u540e\u3002\u7a7a\u767d\u884c\u540c\u6837\u4f1a\u88ab\u5ffd\u7565\u3002\u6709\u5173\u5982\u4f55\u5728\u5339\u914d\u6a21\u5f0f\u4e2d\u52a0\u5f15\u53f7\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\u3002</p>\n<p lang=\"zh\">\u793a\u4f8b\u6587\u4ef6\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/17/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u4e00\u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/17/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u6ce8\u91ca\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-table-access-method</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-toast-compression</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e <acronym class=\"acronym\">TOAST</acronym> \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">data \u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u548c\u5e8f\u5217\u503c\u3002post-data \u90e8\u5206\u5305\u542b\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u542b\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/17/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/17/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.98.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.98</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/17/logicaldecoding.html\" title=\"\u7b2c\u00a047\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a047\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08<code class=\"option\">-e</code>/<code class=\"option\">--extension</code>\uff09\u3001\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 <code class=\"option\">--filter</code> \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 <span class=\"application\">pg_dump</span> \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 <code class=\"option\">--strict-names</code> \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5bf9 <code class=\"option\">--exclude-extension</code>\u3001<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u6216 <code class=\"option\">--exclude-table-data</code> \u6ca1\u6709\u6548\u679c\u3002\u672a\u5339\u914d\u4efb\u4f55\u5bf9\u8c61\u7684\u6392\u9664\u6a21\u5f0f\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f53\u8bbe\u4e3a <code class=\"literal\">fsync</code> \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c<code class=\"command\">pg_dump --format=directory</code> \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002</p>\n<p lang=\"zh\">\u5728 Linux \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u6539\u7528 <code class=\"literal\">syncfs</code>\uff0c\u8ba9\u64cd\u4f5c\u7cfb\u7edf\u540c\u6b65\u5305\u542b\u5f52\u6863\u76ee\u5f55\u7684\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u3002\u5173\u4e8e\u9700\u8981\u6ce8\u610f\u7684\u95ee\u9898\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/17/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a>\u4e2d\u6709\u5173\u4f7f\u7528 <code class=\"literal\">syncfs</code> \u7684\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u5f53\u4f7f\u7528 <code class=\"option\">--no-sync</code>\uff0c\u6216 <code class=\"option\">--format</code> \u672a\u8bbe\u4e3a <code class=\"literal\">directory</code> \u65f6\uff0c\u6b64\u9009\u9879\u6ca1\u6709\u6548\u679c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/17/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/17/libpq-envars.html\" title=\"32.15.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a032.15\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/17/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4ec5\u6570\u636e\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span>\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e0d\u5305\u542b\u4f18\u5316\u5668\u7528\u4e8e\u51b3\u5b9a\u67e5\u8be2\u8ba1\u5212\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\uff0c\u6700\u597d\u8fd0\u884c<code class=\"command\">ANALYZE</code>\u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff1b\u66f4\u591a\u4fe1\u606f\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/17/routine-vacuuming.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/17/routine-vacuuming.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 9.2 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002\u5982\u679c\u7528\u6237\u6253\u7b97\u5728\u5237\u65b0\u671f\u95f4\u590d\u5236\u521d\u59cb\u6570\u636e\uff0c\u5219\u5fc5\u987b\u4ee5 <code class=\"literal\">two_phase = false</code> \u521b\u5efa\u8be5\u69fd\u3002\u521d\u59cb\u540c\u6b65\u4e4b\u540e\uff0c\u8ba2\u9605\u8005\u4f1a\u81ea\u52a8\u542f\u7528 <a class=\"link\" href=\"/docs/17/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\uff0c\u524d\u63d0\u662f\u8be5\u8ba2\u9605\u6700\u521d\u662f\u4ee5 <code class=\"literal\">two_phase = true</code> \u9009\u9879\u521b\u5efa\u7684\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u628a\u6570\u636e\u5e93 <code class=\"literal\">mydb</code> \u8f6c\u50a8\u5230\u4e00\u4e2a SQL \u811a\u672c\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\uff0c\u5982\u679c\u8981\u6307\u5b9a\u4e00\u4e2a\u5927\u5199\u6216\u6df7\u5408\u5927\u5c0f\u5199\u7684\u540d\u79f0\uff0c\u5c31\u9700\u8981\u5bf9\u8be5\u540d\u79f0\u52a0\u53cc\u5f15\u53f7\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u6210\u5c0f\u5199\uff08\u89c1<a class=\"xref\" href=\"/docs/17/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6765\u8bf4\u53c8\u662f\u7279\u6b8a\u5b57\u7b26\uff0c\u56e0\u6b64\u53cd\u8fc7\u6765\u8fd8\u5fc5\u987b\u518d\u88ab\u5f15\u7528\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u5177\u6709\u6df7\u5408\u5927\u5c0f\u5199\u540d\u79f0\u7684\u5355\u4e2a\u8868\uff0c\u9700\u8981\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u6240\u6709\u540d\u79f0\u4ee5 <code class=\"literal\">mytable</code> \u5f00\u5934\u3001\u4f46\u6392\u9664 <code class=\"literal\">mytable2</code> \u8868\u7684\u8868\uff0c\u8bf7\u6307\u5b9a\u5982\u4e0b\u8fc7\u6ee4\u6587\u4ef6 <code class=\"filename\">filter.txt</code>\uff1a</p>\n<pre class=\"programlisting\">include table mytable*\nexclude table mytable2\n</pre>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump --filter=filter.txt mydb &gt; db.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/17/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/17/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/17/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/17/app-pgdump.html", "method": "same-major semantic node", "sha256": "f47158a3a6e9fe2935c142d10ba8c77427121440d726739448eeed07c3d2eb3e", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[111]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[111]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[115]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[6]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[27]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/17/description/0": "pg_dump \u2014 extract a PostgreSQL database into a script file or other archive file", "/versions/17/facts/0/label": "Documented executable", "/versions/17/facts/1/label": "Executable version", "/versions/17/facts/2/label": "Reference inventory", "/versions/17/facts/2/value": "Client applications", "/versions/17/facts/3/label": "Option definition groups", "/versions/17/tables/0/title": "Documented options", "/versions/17/tables/1/title": "Environment variables", "/versions/17/related/0/label": "libpq connection parameters", "/versions/17/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped.", "/versions/17/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only is.", "/versions/17/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/17/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/17/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/17/tables/0/rows/5/summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "/versions/17/tables/0/rows/6/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "/versions/17/tables/0/rows/7/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/17/tables/0/rows/8/summary": "Selects the format of the output. format can be one of the following:", "/versions/17/tables/0/rows/9/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/17/tables/0/columns/0/label": "Option and arguments", "/versions/17/tables/0/columns/1/label": "Description", "/versions/17/tables/0/rows/10/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/17/tables/0/rows/11/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/17/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/17/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/17/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data.", "/versions/17/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/17/tables/0/rows/16/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/17/tables/0/rows/17/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/17/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/17/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/17/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/17/tables/0/rows/21/summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "/versions/17/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/17/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/17/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/17/tables/0/rows/25/summary": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/17/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/17/tables/0/rows/27/summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "/versions/17/tables/0/rows/28/summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/17/tables/0/rows/29/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/17/tables/0/rows/30/summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/17/tables/0/rows/31/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/17/tables/0/rows/32/summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "/versions/17/tables/0/rows/33/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/17/tables/0/rows/34/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/17/tables/0/rows/35/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/17/tables/0/rows/36/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/17/tables/0/rows/37/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/17/tables/0/rows/38/summary": "Do not dump comments.", "/versions/17/tables/0/rows/39/summary": "Do not dump publications.", "/versions/17/tables/0/rows/40/summary": "Do not dump security labels.", "/versions/17/tables/0/rows/41/summary": "Do not dump subscriptions.", "/versions/17/tables/0/rows/42/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/17/tables/0/rows/43/summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "/versions/17/tables/0/rows/44/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/17/tables/0/rows/45/summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "/versions/17/tables/0/rows/46/summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "/versions/17/tables/0/rows/47/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/17/tables/0/rows/48/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/17/tables/0/rows/49/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/17/tables/0/rows/50/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/17/tables/0/rows/51/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/17/tables/0/rows/52/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/17/tables/0/rows/53/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.98 for more details).", "/versions/17/tables/0/rows/54/summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "/versions/17/tables/0/rows/55/summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "/versions/17/tables/0/rows/56/summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/17/tables/0/rows/57/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/17/tables/0/rows/58/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/17/tables/0/rows/59/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/17/tables/0/rows/60/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/17/tables/0/rows/61/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/17/tables/0/rows/62/summary": "User name to connect as.", "/versions/17/tables/0/rows/63/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/17/tables/0/rows/64/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/17/tables/0/rows/65/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/17/tables/1/columns/0/label": "Variable", "/versions/17/tables/1/columns/1/label": "Meaning", "/versions/17/tables/1/rows/0/description": "Default connection parameters.", "/versions/17/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .", "/versions/17/tables/0/rows/1/signature/text": "-b --large-objects --blobs (deprecated)", "/versions/17/tables/0/rows/2/signature/text": "-B --no-large-objects --no-blobs (deprecated)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "7c90d0e6229bf6eb5063ba386e3ff9cdba3485ce8617b4f0fc371da70c8bd73f"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions). Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "signature": "-b --large-objects --blobs (deprecated)", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , or --schema-only is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "signature": "-B --no-large-objects --no-blobs (deprecated)", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "signature": "-e pattern --extension= pattern", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data. This option is the inverse of --data-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a data-only dump. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "signature": "--exclude-extension= pattern", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "signature": "--exclude-table-and-children= pattern", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "signature": "--exclude-table-data-and-children= pattern", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "signature": "--filter= filename", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump comments."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "signature": "--no-table-access-method", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "signature": "--no-toast-compression", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.98 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "signature": "--table-and-children= pattern", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "fa45a8fa5d81d236bed47009c044efc2d9a63d1a7a2dfcc568a8472547a05fff", "manual_language": "zh"}, "18": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "18.6"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "73"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u7edf\u8ba1\u4fe1\u606f\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u3001 --schema-only \u3001 --statistics-only \u6216 --no-data \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u518d\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u6216 --statistics-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-b --large-objects --blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-B --no-large-objects --no-blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u4ec5\u8f6c\u50a8\u4e0e pattern \u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -e \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-e pattern --extension= pattern"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728 \u7b2c 23.3.1 \u8282 \u4e2d\u63cf\u8ff0\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u6216\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a gzip \u3001 lz4 \u3001 zstd \u6216 none \uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 keyword \u6216 keyword=value \u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f level \u548c long \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4\uff08 INSERT INTO table ( column , ...) VALUES ... \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u5305\u542b\u6570\u636e\u4f46\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -e \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-extension \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--exclude-extension= pattern"}}, {"summary": "\u8fd9\u4e0e -T / --exclude-table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--exclude-table-and-children= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u8fd9\u4e0e --exclude-table-data \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--exclude-table-data-and-children= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 -t / --table \u3001 --table-and-children \u3001 -T / --exclude-table \u548c --exclude-table-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 -n / --schema \u548c -N / --exclude-schema \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 --include-foreign-data \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 --exclude-table-data \u548c --exclude-table-data-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 -e / --extension \u548c --exclude-extension \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece STDIN \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 - \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002 --filter \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--filter= filename"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8 COMMENT \u547d\u4ee4\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-data"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u884c\u5b89\u5168\u6027\u7b56\u7565\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-policies"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-schema"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-statistics"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-table-access-method"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e TOAST \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-toast-compression"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5e8f\u5217\u6570\u636e\u3002\u9664\u975e\u6307\u5b9a\u4e86 --no-data \u3001 --schema-only \u6216 --statistics-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--sequence-data"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.100 \uff09\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8f6c\u50a8\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--statistics"}}, {"summary": "\u53ea\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u6570\u636e\u3002\u4f1a\u8f6c\u50a8\u8868\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u7d22\u5f15\u7684\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--statistics-only"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08 -e / --extension \uff09\u3001\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 --filter \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 pg_dump \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 --strict-names \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u5f53\u8bbe\u4e3a fsync \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c pg_dump --format=directory \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--sync-method= method"}}, {"summary": "\u8fd9\u4e0e -t / --table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--table-and-children= pattern"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is.", "signature": "-b --large-objects --blobs (deprecated)", "source_url": "/docs/18/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-large-objects --no-blobs (deprecated)", "source_url": "/docs/18/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/18/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/18/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "signature": "-e pattern --extension= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/18/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/18/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/18/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/18/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/18/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/18/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data or statistics.", "signature": "-s --schema-only", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only the object definitions (schema), not data or statistics. This option cannot be used with --data-only or --statistics-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/18/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/18/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "source_url": "/docs/18/app-pgdump.html", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/18/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/18/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/18/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/18/app-pgdump.html", "description": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/18/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "signature": "--exclude-extension= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-and-children= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only or --statistics-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-data-and-children= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/18/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "signature": "--filter= filename", "source_url": "/docs/18/app-pgdump.html", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/18/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/18/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/18/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/18/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/18/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump COMMENT commands.", "signature": "--no-comments", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump COMMENT commands."}, {"names": ["--no-data"], "summary": "Do not dump data.", "signature": "--no-data", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump data."}, {"names": ["--no-policies"], "summary": "Do not dump row security policies.", "signature": "--no-policies", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump row security policies."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-schema"], "summary": "Do not dump schema (data definitions).", "signature": "--no-schema", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump schema (data definitions)."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-statistics"], "summary": "Do not dump statistics. This is the default.", "signature": "--no-statistics", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump statistics. This is the default."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/18/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "signature": "--no-table-access-method", "source_url": "/docs/18/app-pgdump.html", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/18/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "signature": "--no-toast-compression", "source_url": "/docs/18/app-pgdump.html", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/18/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/18/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/18/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/18/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/18/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items."}, {"names": ["--sequence-data"], "summary": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.", "signature": "--sequence-data", "source_url": "/docs/18/app-pgdump.html", "description": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/18/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.100 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/18/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.100 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--statistics"], "summary": "Dump optimizer statistics.", "signature": "--statistics", "source_url": "/docs/18/app-pgdump.html", "description": "Dump optimizer statistics."}, {"names": ["--statistics-only"], "summary": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.", "signature": "--statistics-only", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."}, {"names": ["--strict-names"], "summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/18/app-pgdump.html", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "signature": "--sync-method= method", "source_url": "/docs/18/app-pgdump.html", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--table-and-children= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/18/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/18/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/18/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/18/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=18", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/18/postgresql-18-A4.pdf", "bytes": 15865106, "pages": 3154, "sha256": "19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/18/postgresql-18-US.pdf", "bytes": 15748059, "pages": 3328, "sha256": "facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319", "built_at": "2026-09-26"}}, "tree": "18", "index": "index.html", "major": "18", "pages": 1148, "release": "18.6", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "revision": "ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8", "evidence_kind": "English manual and source declarations", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "https://pg.center/docs/18/app-pgdump.html", "file": "app-pgdump.html", "label": "18.6 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "758860baaa3462061cc6343b8d04559ec3fbc9e77c00e426f5eb8b32c863509e", "language": "en", "original_url": "/docs/18/app-pgdump.html"}, {"url": "https://pg.center/docs/18/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0", "language": "en", "original_url": "/docs/18/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06 PostgreSQL \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_dump</span></span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06 <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.14.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u662f\u4e00\u4e2a\u7528\u4e8e\u5bfc\u51fa <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5bfc\u51fa\u7ed3\u679c\u3002<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u9664\u4e86\u7b80\u5355\u573a\u666f\u4e4b\u5916\uff0c<span class=\"application\">pg_dump</span> \u901a\u5e38\u5e76\u4e0d\u662f\u5bf9\u751f\u4ea7\u6570\u636e\u5e93\u8fdb\u884c\u5e38\u89c4\u5907\u4efd\u7684\u6b63\u786e\u9009\u62e9\u3002\u8fdb\u4e00\u6b65\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/18/backup.html\" title=\"\u7b2c\u00a025\u00a0\u7ae0\u00a0\u5907\u4efd\u548c\u6062\u590d\">\u7b2c\u00a025\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5bfc\u51fa\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5bfc\u51fa\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/18/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/18/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5bfc\u51fa\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u7edf\u8ba1\u4fe1\u606f\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u3001<code class=\"option\">--schema-only</code>\u3001<code class=\"option\">--statistics-only</code> \u6216 <code class=\"option\">--no-data</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code> \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u518d\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 <code class=\"option\">--data-only</code> \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 <code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code> \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u4e0e<em class=\"replaceable\"><code>pattern</code></em>\u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a<code class=\"option\">-e</code>\u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002</p>\n<p lang=\"zh\">\u7531 <code class=\"function\">pg_extension_config_dump</code> \u6ce8\u518c\u7684\u4efb\u4f55\u914d\u7f6e\u5173\u7cfb\uff0c\u5982\u679c\u5176\u6240\u5c5e\u6269\u5c55\u7531 <code class=\"option\">--extension</code> \u6307\u5b9a\uff0c\u4e5f\u4f1a\u5305\u542b\u5728\u8f6c\u50a8\u4e2d\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a<code class=\"option\">-e</code>\u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6269\u5c55\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6269\u5c55\u7684\u8f6c\u50a8\u7ed3\u679c\u53ef\u4ee5\u6210\u529f\u5730\u5355\u72ec\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728<a class=\"xref\" href=\"/docs/18/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" title=\"23.3.1.\u00a0\u652f\u6301\u7684\u5b57\u7b26\u96c6\">\u7b2c\u00a023.3.1\u00a0\u8282</a>\u4e2d\u63cf\u8ff0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u4f7f\u7528 <code class=\"literal\">gzip</code> \u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u9886\u5bfc\u8005\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff08<a class=\"link\" href=\"/docs/18/explicit-locking.html#LOCKING-TABLES\" title=\"13.3.1.\u00a0\u8868\u7ea7\u9501\">ACCESS SHARE</a>\uff09\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u9886\u5bfc\u8005\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u9886\u5bfc\u8005\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/18/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--large-objects</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u6216\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--data-only</code> \u6216 <code class=\"option\">--statistics-only</code> \u4e00\u8d77\u4f7f\u7528\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/18/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]<br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]</span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a <code class=\"literal\">gzip</code>\u3001<code class=\"literal\">lz4</code>\u3001<code class=\"literal\">zstd</code> \u6216 <code class=\"literal\">none</code>\uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 <code class=\"literal\">keyword</code> \u6216 <code class=\"literal\">keyword=value</code>\u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f <code class=\"literal\">level</code> \u548c <code class=\"literal\">long</code>\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u672a\u6307\u5b9a\u538b\u7f29\u7ea7\u522b\uff0c\u5c06\u4f7f\u7528\u9ed8\u8ba4\u7ea7\u522b\u3002\u5982\u679c\u53ea\u6307\u5b9a\u7ea7\u522b\u800c\u672a\u6307\u5b9a\u7b97\u6cd5\uff0c\u5219\u7ea7\u522b\u5927\u4e8e 0 \u65f6\u4f7f\u7528 gzip \u538b\u7f29\uff0c\u7ea7\u522b\u4e3a 0 \u65f6\u4e0d\u538b\u7f29\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e custom \u548c directory \u5f52\u6863\u683c\u5f0f\uff0c\u6b64\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u662f\u4f7f\u7528\u4e2d\u7b49\u7ea7\u522b\u7684 <code class=\"literal\">gzip</code> \u8fdb\u884c\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\u88ab\u538b\u7f29\uff0c\u5c31\u50cf\u5b83\u7ecf\u8fc7\u4e86 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u662f\u4e0d\u538b\u7f29\u3002\u4f7f\u7528 zstd \u538b\u7f29\u65f6\uff0c<code class=\"literal\">long</code> \u6a21\u5f0f\u53ef\u80fd\u63d0\u9ad8\u538b\u7f29\u6bd4\uff0c\u4f46\u4ee3\u4ef7\u662f\u5185\u5b58\u4f7f\u7528\u589e\u52a0\u3002</p>\n<p lang=\"zh\">tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u5305\u542b\u6570\u636e\u4f46\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-e</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-extension</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-e</code> \u548c <code class=\"option\">--exclude-extension</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-e</code> \u5f00\u5173\u3001\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">--exclude-extension</code> \u5f00\u5173\u7684\u6269\u5c55\u3002\u5982\u679c <code class=\"option\">--exclude-extension</code> \u5728\u6ca1\u6709 <code class=\"option\">-e</code> \u7684\u60c5\u51b5\u4e0b\u51fa\u73b0\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">--exclude-extension</code> \u7684\u6269\u5c55\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u82e5\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--filter=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 <code class=\"option\">-t</code>/<code class=\"option\">--table</code>\u3001<code class=\"option\">--table-and-children</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u548c <code class=\"option\">--exclude-table-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u548c <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--exclude-table-data</code> \u548c <code class=\"option\">--exclude-table-data-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u548c <code class=\"option\">--exclude-extension</code> \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece <code class=\"literal\">STDIN</code> \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 <code class=\"filename\">-</code> \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002<code class=\"option\">--filter</code> \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002</p>\n<p lang=\"zh\">\u6587\u4ef6\u6bcf\u884c\u5217\u51fa\u4e00\u4e2a\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a</p>\n<pre class=\"synopsis\">{ include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } <em class=\"replaceable\"><code>PATTERN</code></em>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e00\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u662f\u5305\u542b\u8fd8\u662f\u6392\u9664\u4e0e\u6a21\u5f0f\u5339\u914d\u7684\u5bf9\u8c61\u3002\u7b2c\u4e8c\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u8981\u7528\u8be5\u6a21\u5f0f\u8fc7\u6ee4\u7684\u5bf9\u8c61\u7c7b\u578b\uff1a</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">extension</code>\uff1a\u6269\u5c55\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u6216 <code class=\"option\">--exclude-extension</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">foreign_data</code>\uff1a\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--include-foreign-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">include</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table</code>\uff1a\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u6216 <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_and_children</code>\uff1a\u8868\uff0c\u4ee5\u53ca\u5176\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--table-and-children</code> \u6216 <code class=\"option\">--exclude-table-and-children</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data_and_children</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\uff0c\u4ee5\u53ca\u8fd9\u4e9b\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data-and-children</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">schema</code>\uff1a\u6a21\u5f0f\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u6216 <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u9009\u9879\u3002</p>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u4ee5 <code class=\"literal\">#</code> \u5f00\u5934\u7684\u884c\u88ab\u89c6\u4e3a\u6ce8\u91ca\u5e76\u5ffd\u7565\u3002\u6ce8\u91ca\u4e5f\u53ef\u4ee5\u653e\u5728\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u884c\u4e4b\u540e\u3002\u7a7a\u767d\u884c\u540c\u6837\u4f1a\u88ab\u5ffd\u7565\u3002\u6709\u5173\u5982\u4f55\u5728\u5339\u914d\u6a21\u5f0f\u4e2d\u52a0\u5f15\u53f7\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\u3002</p>\n<p lang=\"zh\">\u793a\u4f8b\u6587\u4ef6\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/18/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u4e00\u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/18/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8 <code class=\"command\">COMMENT</code> \u547d\u4ee4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-policies</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u884c\u5b89\u5168\u6027\u7b56\u7565\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-schema</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-statistics</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-table-access-method</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-toast-compression</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e <acronym class=\"acronym\">TOAST</acronym> \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">\u6570\u636e\u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u3001\u5e8f\u5217\u503c\uff0c\u4ee5\u53ca\u8868\u3001\u7269\u5316\u89c6\u56fe\u548c\u5916\u90e8\u8868\u7684\u7edf\u8ba1\u4fe1\u606f\u3002post-data \u90e8\u5206\u5305\u62ec\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\u3001\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u548c\u975e\u7a7a\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u62ec\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sequence-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5e8f\u5217\u6570\u636e\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-data</code>\u3001<code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/18/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.100.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.100</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/logicaldecoding.html\" title=\"\u7b2c\u00a047\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a047\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--statistics</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f6c\u50a8\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--statistics-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u6570\u636e\u3002\u4f1a\u8f6c\u50a8\u8868\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u7d22\u5f15\u7684\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08<code class=\"option\">-e</code>/<code class=\"option\">--extension</code>\uff09\u3001\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 <code class=\"option\">--filter</code> \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 <span class=\"application\">pg_dump</span> \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 <code class=\"option\">--strict-names</code> \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5bf9 <code class=\"option\">--exclude-extension</code>\u3001<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u6216 <code class=\"option\">--exclude-table-data</code> \u6ca1\u6709\u6548\u679c\u3002\u672a\u5339\u914d\u4efb\u4f55\u5bf9\u8c61\u7684\u6392\u9664\u6a21\u5f0f\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f53\u8bbe\u4e3a <code class=\"literal\">fsync</code> \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c<code class=\"command\">pg_dump --format=directory</code> \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002</p>\n<p lang=\"zh\">\u5728 Linux \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u6539\u7528 <code class=\"literal\">syncfs</code>\uff0c\u8ba9\u64cd\u4f5c\u7cfb\u7edf\u540c\u6b65\u5305\u542b\u5f52\u6863\u76ee\u5f55\u7684\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u3002\u5173\u4e8e\u9700\u8981\u6ce8\u610f\u7684\u95ee\u9898\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a>\u4e2d\u6709\u5173\u4f7f\u7528 <code class=\"literal\">syncfs</code> \u7684\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u5f53\u4f7f\u7528 <code class=\"option\">--no-sync</code>\uff0c\u6216 <code class=\"option\">--format</code> \u672a\u8bbe\u4e3a <code class=\"literal\">directory</code> \u65f6\uff0c\u6b64\u9009\u9879\u6ca1\u6709\u6548\u679c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a032.15\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">--statistics</code> \u65f6\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u5728\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e2d\u5305\u542b\u5927\u591a\u6570\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002\u4f46\u8fd9\u5e76\u4e0d\u5305\u62ec\u6240\u6709\u7edf\u8ba1\u4fe1\u606f\uff0c\u4f8b\u5982\u901a\u8fc7<a class=\"xref\" href=\"/docs/18/sql-createstatistics.html\" title=\"CREATE STATISTICS\"><span class=\"refentrytitle\">CREATE STATISTICS</span></a>\u663e\u5f0f\u521b\u5efa\u7684\u7edf\u8ba1\u4fe1\u606f\u3001\u6269\u5c55\u6dfb\u52a0\u7684\u81ea\u5b9a\u4e49\u7edf\u8ba1\u4fe1\u606f\uff0c\u6216\u7531\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\u518d\u8fd0\u884c <code class=\"command\">ANALYZE</code> \u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff0c\u53ef\u80fd\u4ecd\u7136\u6709\u7528\uff1b\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/18/routine-vacuuming.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 9.2 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002\u5982\u679c\u7528\u6237\u6253\u7b97\u5728\u5237\u65b0\u671f\u95f4\u590d\u5236\u521d\u59cb\u6570\u636e\uff0c\u5219\u5fc5\u987b\u4ee5 <code class=\"literal\">two_phase = false</code> \u521b\u5efa\u8be5\u69fd\u3002\u521d\u59cb\u540c\u6b65\u4e4b\u540e\uff0c\u8ba2\u9605\u8005\u4f1a\u81ea\u52a8\u542f\u7528 <a class=\"link\" href=\"/docs/18/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\uff0c\u524d\u63d0\u662f\u8be5\u8ba2\u9605\u6700\u521d\u662f\u4ee5 <code class=\"literal\">two_phase = true</code> \u9009\u9879\u521b\u5efa\u7684\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u628a\u6570\u636e\u5e93 <code class=\"literal\">mydb</code> \u8f6c\u50a8\u5230\u4e00\u4e2a SQL \u811a\u672c\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\uff0c\u5982\u679c\u8981\u6307\u5b9a\u4e00\u4e2a\u5927\u5199\u6216\u6df7\u5408\u5927\u5c0f\u5199\u7684\u540d\u79f0\uff0c\u5c31\u9700\u8981\u5bf9\u8be5\u540d\u79f0\u52a0\u53cc\u5f15\u53f7\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u6210\u5c0f\u5199\uff08\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6765\u8bf4\u53c8\u662f\u7279\u6b8a\u5b57\u7b26\uff0c\u56e0\u6b64\u53cd\u8fc7\u6765\u8fd8\u5fc5\u987b\u518d\u88ab\u5f15\u7528\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u5177\u6709\u6df7\u5408\u5927\u5c0f\u5199\u540d\u79f0\u7684\u5355\u4e2a\u8868\uff0c\u9700\u8981\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u6240\u6709\u540d\u79f0\u4ee5 <code class=\"literal\">mytable</code> \u5f00\u5934\u3001\u4f46\u6392\u9664 <code class=\"literal\">mytable2</code> \u8868\u7684\u8868\uff0c\u8bf7\u6307\u5b9a\u5982\u4e0b\u8fc7\u6ee4\u6587\u4ef6 <code class=\"filename\">filter.txt</code>\uff1a</p>\n<pre class=\"programlisting\">include table mytable*\nexclude table mytable2\n</pre>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump --filter=filter.txt mydb &gt; db.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/18/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/18/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/18/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/app-pgdump.html", "method": "same-major semantic node", "sha256": "dfdd38193cf6167285dd5f9dddb89e2d0e3954ffb9f625f2aed61916978ad0f9", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[111]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[115]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[121]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[123]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[125]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[125]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[129]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[131]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[133]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[6]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[27]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "pg_dump \u2014 export a PostgreSQL database as an SQL script or to other formats", "/versions/18/facts/0/label": "Documented executable", "/versions/18/facts/1/label": "Executable version", "/versions/18/facts/2/label": "Reference inventory", "/versions/18/facts/2/value": "Client applications", "/versions/18/facts/3/label": "Option definition groups", "/versions/18/tables/0/title": "Documented options", "/versions/18/tables/1/title": "Environment variables", "/versions/18/related/0/label": "libpq connection parameters", "/versions/18/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped.", "/versions/18/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is.", "/versions/18/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/18/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/18/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/18/tables/0/rows/5/summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "/versions/18/tables/0/rows/6/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "/versions/18/tables/0/rows/7/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/18/tables/0/rows/8/summary": "Selects the format of the output. format can be one of the following:", "/versions/18/tables/0/rows/9/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/18/tables/0/columns/0/label": "Option and arguments", "/versions/18/tables/0/columns/1/label": "Description", "/versions/18/tables/0/rows/10/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/18/tables/0/rows/11/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/18/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/18/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/18/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data or statistics.", "/versions/18/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/18/tables/0/rows/16/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/18/tables/0/rows/17/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/18/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/18/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/18/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/18/tables/0/rows/21/summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "/versions/18/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/18/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/18/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/18/tables/0/rows/25/summary": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/18/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/18/tables/0/rows/27/summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "/versions/18/tables/0/rows/28/summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/18/tables/0/rows/29/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/18/tables/0/rows/30/summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/18/tables/0/rows/31/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/18/tables/0/rows/32/summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "/versions/18/tables/0/rows/33/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/18/tables/0/rows/34/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/18/tables/0/rows/35/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/18/tables/0/rows/36/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/18/tables/0/rows/37/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/18/tables/0/rows/38/summary": "Do not dump COMMENT commands.", "/versions/18/tables/0/rows/39/summary": "Do not dump data.", "/versions/18/tables/0/rows/40/summary": "Do not dump row security policies.", "/versions/18/tables/0/rows/41/summary": "Do not dump publications.", "/versions/18/tables/0/rows/42/summary": "Do not dump schema (data definitions).", "/versions/18/tables/0/rows/43/summary": "Do not dump security labels.", "/versions/18/tables/0/rows/44/summary": "Do not dump statistics. This is the default.", "/versions/18/tables/0/rows/45/summary": "Do not dump subscriptions.", "/versions/18/tables/0/rows/46/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/18/tables/0/rows/47/summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "/versions/18/tables/0/rows/48/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/18/tables/0/rows/49/summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "/versions/18/tables/0/rows/50/summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "/versions/18/tables/0/rows/51/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/18/tables/0/rows/52/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/18/tables/0/rows/53/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/18/tables/0/rows/54/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/18/tables/0/rows/55/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/18/tables/0/rows/56/summary": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.", "/versions/18/tables/0/rows/57/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/18/tables/0/rows/58/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.100 for more details).", "/versions/18/tables/0/rows/59/summary": "Dump optimizer statistics.", "/versions/18/tables/0/rows/60/summary": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.", "/versions/18/tables/0/rows/61/summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "/versions/18/tables/0/rows/62/summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "/versions/18/tables/0/rows/63/summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/18/tables/0/rows/64/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/18/tables/0/rows/65/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/18/tables/0/rows/66/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/18/tables/0/rows/67/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/18/tables/0/rows/68/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/18/tables/0/rows/69/summary": "User name to connect as.", "/versions/18/tables/0/rows/70/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/18/tables/0/rows/71/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/18/tables/0/rows/72/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/18/tables/1/columns/0/label": "Variable", "/versions/18/tables/1/columns/1/label": "Meaning", "/versions/18/tables/1/rows/0/description": "Default connection parameters.", "/versions/18/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .", "/versions/18/tables/0/rows/1/signature/text": "-b --large-objects --blobs (deprecated)", "/versions/18/tables/0/rows/2/signature/text": "-B --no-large-objects --no-blobs (deprecated)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "dd59d05ee1a0f6fe95519e67ac2b7149cd761c97016d211fa2036fad8c0a41e8"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "signature": "-b --large-objects --blobs (deprecated)", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "signature": "-B --no-large-objects --no-blobs (deprecated)", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "signature": "-e pattern --extension= pattern", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data or statistics. This option cannot be used with --data-only or --statistics-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "signature": "--exclude-extension= pattern", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "signature": "--exclude-table-and-children= pattern", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only or --statistics-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "signature": "--exclude-table-data-and-children= pattern", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "signature": "--filter= filename", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump COMMENT commands."}, {"names": ["--no-data"], "signature": "--no-data", "description": "Do not dump data."}, {"names": ["--no-policies"], "signature": "--no-policies", "description": "Do not dump row security policies."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-schema"], "signature": "--no-schema", "description": "Do not dump schema (data definitions)."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-statistics"], "signature": "--no-statistics", "description": "Do not dump statistics. This is the default."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "signature": "--no-table-access-method", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "signature": "--no-toast-compression", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items."}, {"names": ["--sequence-data"], "signature": "--sequence-data", "description": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.100 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--statistics"], "signature": "--statistics", "description": "Dump optimizer statistics."}, {"names": ["--statistics-only"], "signature": "--statistics-only", "description": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "signature": "--table-and-children= pattern", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "e4fc1961ca5ae638ffddf6b82d9336086bc97a70b652b15a5b41f476128da561", "manual_language": "zh"}, "19": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "19beta4"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "73"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u7edf\u8ba1\u4fe1\u606f\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u3001 --schema-only \u3001 --statistics-only \u6216 --no-data \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u518d\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u6216 --statistics-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-b --large-objects --blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-B --no-large-objects --no-blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u4ec5\u8f6c\u50a8\u4e0e pattern \u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -e \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-e pattern --extension= pattern"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728 \u7b2c 23.3.1 \u8282 \u4e2d\u63cf\u8ff0\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u9664\u975e\u8be5\u76ee\u5f55\u5df2\u5b58\u5728\u4e14\u4e3a\u7a7a\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u6216\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a gzip \u3001 lz4 \u3001 zstd \u6216 none \uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 keyword \u6216 keyword=value \u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f level \u548c long \u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4\uff08 INSERT INTO table ( column , ...) VALUES ... \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u5305\u542b\u6570\u636e\u4f46\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -e \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-extension \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--exclude-extension= pattern"}}, {"summary": "\u8fd9\u4e0e -T / --exclude-table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--exclude-table-and-children= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u8fd9\u4e0e --exclude-table-data \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--exclude-table-data-and-children= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 -t / --table \u3001 --table-and-children \u3001 -T / --exclude-table \u548c --exclude-table-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 -n / --schema \u548c -N / --exclude-schema \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 --include-foreign-data \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 --exclude-table-data \u548c --exclude-table-data-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 -e / --extension \u548c --exclude-extension \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece STDIN \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 - \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002 --filter \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--filter= filename"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8 COMMENT \u547d\u4ee4\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-data"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u884c\u5b89\u5168\u6027\u7b56\u7565\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-policies"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-schema"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-statistics"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-table-access-method"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e TOAST \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-toast-compression"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5e8f\u5217\u6570\u636e\u3002\u9664\u975e\u6307\u5b9a\u4e86 --no-data \u3001 --schema-only \u6216 --statistics-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--sequence-data"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.101 \uff09\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8f6c\u50a8\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--statistics"}}, {"summary": "\u53ea\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u6570\u636e\u3002\u4f1a\u8f6c\u50a8\u8868\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u7d22\u5f15\u7684\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--statistics-only"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08 -e / --extension \uff09\u3001\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 --filter \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 pg_dump \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 --strict-names \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u5f53\u8bbe\u4e3a fsync \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c pg_dump --format=directory \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--sync-method= method"}}, {"summary": "\u8fd9\u4e0e -t / --table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--table-and-children= pattern"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/19/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/19/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is.", "signature": "-b --large-objects --blobs (deprecated)", "source_url": "/docs/19/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-large-objects --no-blobs (deprecated)", "source_url": "/docs/19/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/19/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/19/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "signature": "-e pattern --extension= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note pg_dump does not dump the extension's underlying installation files (such as shared libraries or control files). These must be available on the destination system for the restore to succeed."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/19/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump unless the directory exists and is empty.", "signature": "-f file --file= file", "source_url": "/docs/19/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump unless the directory exists and is empty."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/19/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/19/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/19/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/19/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data or statistics.", "signature": "-s --schema-only", "source_url": "/docs/19/app-pgdump.html", "description": "Dump only the object definitions (schema), not data or statistics. This option cannot be used with --data-only or --statistics-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/19/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/19/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/19/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/19/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "source_url": "/docs/19/app-pgdump.html", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/19/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/19/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/19/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/19/app-pgdump.html", "description": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/19/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "signature": "--exclude-extension= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-and-children= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only or --statistics-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-data-and-children= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/19/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "signature": "--filter= filename", "source_url": "/docs/19/app-pgdump.html", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/19/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/19/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/19/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/19/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/19/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump COMMENT commands.", "signature": "--no-comments", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump COMMENT commands."}, {"names": ["--no-data"], "summary": "Do not dump data.", "signature": "--no-data", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump data."}, {"names": ["--no-policies"], "summary": "Do not dump row security policies.", "signature": "--no-policies", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump row security policies."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-schema"], "summary": "Do not dump schema (data definitions).", "signature": "--no-schema", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump schema (data definitions)."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-statistics"], "summary": "Do not dump statistics. This is the default.", "signature": "--no-statistics", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump statistics. This is the default."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/19/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "signature": "--no-table-access-method", "source_url": "/docs/19/app-pgdump.html", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/19/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "signature": "--no-toast-compression", "source_url": "/docs/19/app-pgdump.html", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/19/app-pgdump.html", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/19/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/19/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/19/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/19/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/19/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items."}, {"names": ["--sequence-data"], "summary": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.", "signature": "--sequence-data", "source_url": "/docs/19/app-pgdump.html", "description": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/19/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.101 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/19/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.101 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--statistics"], "summary": "Dump optimizer statistics.", "signature": "--statistics", "source_url": "/docs/19/app-pgdump.html", "description": "Dump optimizer statistics."}, {"names": ["--statistics-only"], "summary": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.", "signature": "--statistics-only", "source_url": "/docs/19/app-pgdump.html", "description": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."}, {"names": ["--strict-names"], "summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/19/app-pgdump.html", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "signature": "--sync-method= method", "source_url": "/docs/19/app-pgdump.html", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--table-and-children= pattern", "source_url": "/docs/19/app-pgdump.html", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/19/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/19/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/19/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/19/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/19/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/19/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/19/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/19/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/19/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=19", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "label": "19beta4", "major": "19", "channel": "preview", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/19/postgresql-19-A4.pdf", "bytes": 16064841, "pages": 3052, "sha256": "4dd099e4125c591128fc5f3ebd02178dc24781f9e5ae629f96d67c4c8547427b", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/19/postgresql-19-US.pdf", "bytes": 15974616, "pages": 3225, "sha256": "61971fa857f0956d47341a0388fa6af9ae10acf691d4b2fc009007d384b0342b", "built_at": "2026-09-26"}}, "tree": "19", "index": "index.html", "major": "19", "pages": 1155, "release": "19beta4", "source_url": "https://ftp.postgresql.org/pub/source/v19beta4/postgresql-19beta4.tar.bz2", "svg_assets": 5, "source_mode": "en SGML built with pinned official archive", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "revision": "1bbbbf4133d426f0e4304010688d2984c30fb67df0cc3a61b3e37eb3f6f37833", "evidence_kind": "English manual and source declarations", "source_sha256": "83157ee9c599d03b2f7a3d73ef3a56ec24e0e79cc2b3501a64d1364f56398c86"}, "sources": [{"url": "https://pg.center/docs/19/app-pgdump.html", "file": "app-pgdump.html", "label": "19beta4 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "f89df9101a17f8b5d42f73eccd5660ed1d2bce4df2001ae45fdbd75e9caa7e5d", "language": "en", "original_url": "/docs/19/app-pgdump.html"}, {"url": "https://pg.center/docs/19/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "c827f460db781b39da305303c88e73729a419cd2b2b9dedb126d8ad5cbf02c95", "language": "en", "original_url": "/docs/19/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06 PostgreSQL \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_dump</span></span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06 <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.14.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u662f\u4e00\u4e2a\u7528\u4e8e\u5bfc\u51fa <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5bfc\u51fa\u7ed3\u679c\u3002<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u9664\u4e86\u7b80\u5355\u573a\u666f\u4e4b\u5916\uff0c<span class=\"application\">pg_dump</span> \u901a\u5e38\u5e76\u4e0d\u662f\u5bf9\u751f\u4ea7\u6570\u636e\u5e93\u8fdb\u884c\u5e38\u89c4\u5907\u4efd\u7684\u6b63\u786e\u9009\u62e9\u3002\u8fdb\u4e00\u6b65\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/19/backup.html\" title=\"\u7b2c\u00a025\u00a0\u7ae0\u00a0\u5907\u4efd\u548c\u6062\u590d\">\u7b2c\u00a025\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5bfc\u51fa\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5bfc\u51fa\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/19/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/19/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/19/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5bfc\u51fa\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u7edf\u8ba1\u4fe1\u606f\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u3001<code class=\"option\">--schema-only</code>\u3001<code class=\"option\">--statistics-only</code> \u6216 <code class=\"option\">--no-data</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code> \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u518d\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 <code class=\"option\">--data-only</code> \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 <code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code> \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u4e0e<em class=\"replaceable\"><code>pattern</code></em>\u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a<code class=\"option\">-e</code>\u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002</p>\n<p lang=\"zh\">\u7531 <code class=\"function\">pg_extension_config_dump</code> \u6ce8\u518c\u7684\u4efb\u4f55\u914d\u7f6e\u5173\u7cfb\uff0c\u5982\u679c\u5176\u6240\u5c5e\u6269\u5c55\u7531 <code class=\"option\">--extension</code> \u6307\u5b9a\uff0c\u4e5f\u4f1a\u5305\u542b\u5728\u8f6c\u50a8\u4e2d\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u8f6c\u50a8\u6269\u5c55\u7684\u5e95\u5c42\u5b89\u88c5\u6587\u4ef6\uff08\u4f8b\u5982\u5171\u4eab\u5e93\u6216\u63a7\u5236\u6587\u4ef6\uff09\u3002\u8981\u5728\u76ee\u6807\u7cfb\u7edf\u4e0a\u6210\u529f\u6062\u590d\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5fc5\u987b\u53ef\u7528\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728<a class=\"xref\" href=\"/docs/19/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" title=\"23.3.1.\u00a0\u652f\u6301\u7684\u5b57\u7b26\u96c6\">\u7b2c\u00a023.3.1\u00a0\u8282</a>\u4e2d\u63cf\u8ff0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u9664\u975e\u8be5\u76ee\u5f55\u5df2\u5b58\u5728\u4e14\u4e3a\u7a7a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u4f7f\u7528 <code class=\"literal\">gzip</code> \u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/19/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u9886\u5bfc\u8005\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff08<a class=\"link\" href=\"/docs/19/explicit-locking.html#LOCKING-TABLES\" title=\"13.3.1.\u00a0\u8868\u7ea7\u9501\">ACCESS SHARE</a>\uff09\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u9886\u5bfc\u8005\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u9886\u5bfc\u8005\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/19/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--large-objects</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u6216\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--data-only</code> \u6216 <code class=\"option\">--statistics-only</code> \u4e00\u8d77\u4f7f\u7528\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/19/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]<br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]</span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a <code class=\"literal\">gzip</code>\u3001<code class=\"literal\">lz4</code>\u3001<code class=\"literal\">zstd</code> \u6216 <code class=\"literal\">none</code>\uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 <code class=\"literal\">keyword</code> \u6216 <code class=\"literal\">keyword=value</code>\u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f <code class=\"literal\">level</code> \u548c <code class=\"literal\">long</code>\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u672a\u6307\u5b9a\u538b\u7f29\u7ea7\u522b\uff0c\u5c06\u4f7f\u7528\u9ed8\u8ba4\u7ea7\u522b\u3002\u5982\u679c\u53ea\u6307\u5b9a\u7ea7\u522b\u800c\u672a\u6307\u5b9a\u7b97\u6cd5\uff0c\u5219\u7ea7\u522b\u5927\u4e8e 0 \u65f6\u4f7f\u7528 gzip \u538b\u7f29\uff0c\u7ea7\u522b\u4e3a 0 \u65f6\u4e0d\u538b\u7f29\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e custom \u548c directory \u5f52\u6863\u683c\u5f0f\uff0c\u6b64\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u662f\u4f7f\u7528\u4e2d\u7b49\u7ea7\u522b\u7684 <code class=\"literal\">gzip</code> \u8fdb\u884c\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\u88ab\u538b\u7f29\uff0c\u5c31\u50cf\u5b83\u7ecf\u8fc7\u4e86 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u662f\u4e0d\u538b\u7f29\u3002\u4f7f\u7528 zstd \u538b\u7f29\u65f6\uff0c<code class=\"literal\">long</code> \u6a21\u5f0f\u53ef\u80fd\u63d0\u9ad8\u538b\u7f29\u6bd4\uff0c\u4f46\u4ee3\u4ef7\u662f\u5185\u5b58\u4f7f\u7528\u589e\u52a0\u3002</p>\n<p lang=\"zh\">tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u5305\u542b\u6570\u636e\u4f46\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/19/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/19/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-e</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-extension</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-e</code> \u548c <code class=\"option\">--exclude-extension</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-e</code> \u5f00\u5173\u3001\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">--exclude-extension</code> \u5f00\u5173\u7684\u6269\u5c55\u3002\u5982\u679c <code class=\"option\">--exclude-extension</code> \u5728\u6ca1\u6709 <code class=\"option\">-e</code> \u7684\u60c5\u51b5\u4e0b\u51fa\u73b0\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">--exclude-extension</code> \u7684\u6269\u5c55\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u82e5\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--filter=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 <code class=\"option\">-t</code>/<code class=\"option\">--table</code>\u3001<code class=\"option\">--table-and-children</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u548c <code class=\"option\">--exclude-table-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u548c <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--exclude-table-data</code> \u548c <code class=\"option\">--exclude-table-data-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u548c <code class=\"option\">--exclude-extension</code> \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece <code class=\"literal\">STDIN</code> \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 <code class=\"filename\">-</code> \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002<code class=\"option\">--filter</code> \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002</p>\n<p lang=\"zh\">\u6587\u4ef6\u6bcf\u884c\u5217\u51fa\u4e00\u4e2a\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a</p>\n<pre class=\"synopsis\">{ include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } <em class=\"replaceable\"><code>PATTERN</code></em>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e00\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u662f\u5305\u542b\u8fd8\u662f\u6392\u9664\u4e0e\u6a21\u5f0f\u5339\u914d\u7684\u5bf9\u8c61\u3002\u7b2c\u4e8c\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u8981\u7528\u8be5\u6a21\u5f0f\u8fc7\u6ee4\u7684\u5bf9\u8c61\u7c7b\u578b\uff1a</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">extension</code>\uff1a\u6269\u5c55\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u6216 <code class=\"option\">--exclude-extension</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">foreign_data</code>\uff1a\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--include-foreign-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">include</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table</code>\uff1a\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u6216 <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_and_children</code>\uff1a\u8868\uff0c\u4ee5\u53ca\u5176\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--table-and-children</code> \u6216 <code class=\"option\">--exclude-table-and-children</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data_and_children</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\uff0c\u4ee5\u53ca\u8fd9\u4e9b\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data-and-children</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">schema</code>\uff1a\u6a21\u5f0f\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u6216 <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u9009\u9879\u3002</p>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u4ee5 <code class=\"literal\">#</code> \u5f00\u5934\u7684\u884c\u88ab\u89c6\u4e3a\u6ce8\u91ca\u5e76\u5ffd\u7565\u3002\u6ce8\u91ca\u4e5f\u53ef\u4ee5\u653e\u5728\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u884c\u4e4b\u540e\u3002\u7a7a\u767d\u884c\u540c\u6837\u4f1a\u88ab\u5ffd\u7565\u3002\u6709\u5173\u5982\u4f55\u5728\u5339\u914d\u6a21\u5f0f\u4e2d\u52a0\u5f15\u53f7\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\u3002</p>\n<p lang=\"zh\">\u793a\u4f8b\u6587\u4ef6\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/19/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u4e00\u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/19/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8 <code class=\"command\">COMMENT</code> \u547d\u4ee4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-policies</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u884c\u5b89\u5168\u6027\u7b56\u7565\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-schema</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-statistics</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-table-access-method</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-toast-compression</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e <acronym class=\"acronym\">TOAST</acronym> \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">\u6570\u636e\u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u3001\u5e8f\u5217\u503c\uff0c\u4ee5\u53ca\u8868\u3001\u7269\u5316\u89c6\u56fe\u548c\u5916\u90e8\u8868\u7684\u7edf\u8ba1\u4fe1\u606f\u3002post-data \u90e8\u5206\u5305\u62ec\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\u3001\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u548c\u975e\u7a7a\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u62ec\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sequence-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5e8f\u5217\u6570\u636e\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-data</code>\u3001<code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/19/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/19/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.101.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.101</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/19/logicaldecoding.html\" title=\"\u7b2c\u00a047\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a047\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--statistics</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f6c\u50a8\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--statistics-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u6570\u636e\u3002\u4f1a\u8f6c\u50a8\u8868\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u7d22\u5f15\u7684\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08<code class=\"option\">-e</code>/<code class=\"option\">--extension</code>\uff09\u3001\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 <code class=\"option\">--filter</code> \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 <span class=\"application\">pg_dump</span> \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 <code class=\"option\">--strict-names</code> \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5bf9 <code class=\"option\">--exclude-extension</code>\u3001<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u6216 <code class=\"option\">--exclude-table-data</code> \u6ca1\u6709\u6548\u679c\u3002\u672a\u5339\u914d\u4efb\u4f55\u5bf9\u8c61\u7684\u6392\u9664\u6a21\u5f0f\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f53\u8bbe\u4e3a <code class=\"literal\">fsync</code> \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c<code class=\"command\">pg_dump --format=directory</code> \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002</p>\n<p lang=\"zh\">\u5728 Linux \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u6539\u7528 <code class=\"literal\">syncfs</code>\uff0c\u8ba9\u64cd\u4f5c\u7cfb\u7edf\u540c\u6b65\u5305\u542b\u5f52\u6863\u76ee\u5f55\u7684\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u3002\u5173\u4e8e\u9700\u8981\u6ce8\u610f\u7684\u95ee\u9898\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/19/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a>\u4e2d\u6709\u5173\u4f7f\u7528 <code class=\"literal\">syncfs</code> \u7684\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u5f53\u4f7f\u7528 <code class=\"option\">--no-sync</code>\uff0c\u6216 <code class=\"option\">--format</code> \u672a\u8bbe\u4e3a <code class=\"literal\">directory</code> \u65f6\uff0c\u6b64\u9009\u9879\u6ca1\u6709\u6548\u679c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/19/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/19/libpq-envars.html\" title=\"32.15.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a032.15\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/19/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-e</code>\u3001<code class=\"option\">-n</code> \u6216 <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u5bf9\u8c61\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u8fd9\u6837\u7684\u8f6c\u50a8\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002\u4f8b\u5982\uff0c\u5982\u679c\u6307\u5b9a\u6062\u590d\u4e00\u4e2a\u5176\u5b9a\u4e49\u5305\u542b\u5916\u952e\u7684\u8868\uff0c\u5219\u4e0d\u4f1a\u81ea\u52a8\u6062\u590d\u8be5\u5916\u952e\u6240\u5f15\u7528\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\">\u521b\u5efa\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u4e0d\u5efa\u8bae\u9650\u5236\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u5bf9\u8c61\u96c6\u5408\uff0c\u800c\u5e94\u5728\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u8bfb\u53d6\u5f52\u6863\u65f6\u518d\u5e94\u7528\u6240\u9700\u7684\u5bf9\u8c61\u8fc7\u6ee4\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u7559\u7075\u6d3b\u6027\uff0c\u5e76\u53ef\u80fd\u907f\u514d\u6062\u590d\u65f6\u51fa\u73b0\u95ee\u9898\uff1b\u8be6\u60c5\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/19/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6587\u6863\u3002\u7279\u522b\u662f\uff0c\u4e0d\u5efa\u8bae\u5728\u6ca1\u6709\u76f8\u5e94\u8868\u5b9a\u4e49\u7684\u60c5\u51b5\u4e0b\u8f6c\u50a8\u8868\u6570\u636e\uff08\u4f8b\u5982\u901a\u8fc7 <code class=\"option\">--no-schema</code> \u53ca\u76f8\u5173\u9009\u9879\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">--statistics</code> \u65f6\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u5728\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e2d\u5305\u542b\u5927\u591a\u6570\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002\u4f46\u8fd9\u5e76\u4e0d\u5305\u62ec\u6240\u6709\u7edf\u8ba1\u4fe1\u606f\uff0c\u4f8b\u5982\u6269\u5c55\u6dfb\u52a0\u7684\u81ea\u5b9a\u4e49\u7edf\u8ba1\u4fe1\u606f\uff0c\u6216\u7531\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\u518d\u8fd0\u884c <code class=\"command\">ANALYZE</code> \u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff0c\u53ef\u80fd\u4ecd\u7136\u6709\u7528\uff1b\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/19/routine-vacuuming.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/19/routine-vacuuming.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 9.2 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002\u5982\u679c\u7528\u6237\u6253\u7b97\u5728\u5237\u65b0\u671f\u95f4\u590d\u5236\u521d\u59cb\u6570\u636e\uff0c\u5219\u5fc5\u987b\u4ee5 <code class=\"literal\">two_phase = false</code> \u521b\u5efa\u8be5\u69fd\u3002\u521d\u59cb\u540c\u6b65\u4e4b\u540e\uff0c\u8ba2\u9605\u8005\u4f1a\u81ea\u52a8\u542f\u7528 <a class=\"link\" href=\"/docs/19/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\uff0c\u524d\u63d0\u662f\u8be5\u8ba2\u9605\u6700\u521d\u662f\u4ee5 <code class=\"literal\">two_phase = true</code> \u9009\u9879\u521b\u5efa\u7684\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u628a\u6570\u636e\u5e93 <code class=\"literal\">mydb</code> \u8f6c\u50a8\u5230\u4e00\u4e2a SQL \u811a\u672c\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\uff0c\u5982\u679c\u8981\u6307\u5b9a\u4e00\u4e2a\u5927\u5199\u6216\u6df7\u5408\u5927\u5c0f\u5199\u7684\u540d\u79f0\uff0c\u5c31\u9700\u8981\u5bf9\u8be5\u540d\u79f0\u52a0\u53cc\u5f15\u53f7\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u6210\u5c0f\u5199\uff08\u89c1<a class=\"xref\" href=\"/docs/19/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6765\u8bf4\u53c8\u662f\u7279\u6b8a\u5b57\u7b26\uff0c\u56e0\u6b64\u53cd\u8fc7\u6765\u8fd8\u5fc5\u987b\u518d\u88ab\u5f15\u7528\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u5177\u6709\u6df7\u5408\u5927\u5c0f\u5199\u540d\u79f0\u7684\u5355\u4e2a\u8868\uff0c\u9700\u8981\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u6240\u6709\u540d\u79f0\u4ee5 <code class=\"literal\">mytable</code> \u5f00\u5934\u3001\u4f46\u6392\u9664 <code class=\"structname\">mytable2</code> \u8868\u7684\u8868\uff0c\u8bf7\u6307\u5b9a\u5982\u4e0b\u8fc7\u6ee4\u6587\u4ef6 <code class=\"filename\">filter.txt</code>\uff1a</p>\n<pre class=\"programlisting\">include table mytable*\nexclude table mytable2\n</pre>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump --filter=filter.txt mydb &gt; db.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/19/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/19/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/19/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/19/app-pgdump.html", "method": "same-major semantic node", "sha256": "90233118031c8597826df7d27137fa21b73f72be3ae4801d0556a1c5c521df3a", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[111]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[115]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[121]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[123]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[125]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[125]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[129]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[131]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[133]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[6]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[8]/p[8]", "#APP-PGDUMP/div[8]/p[9]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[27]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/19/description/0": "pg_dump \u2014 export a PostgreSQL database as an SQL script or to other formats", "/versions/19/facts/0/label": "Documented executable", "/versions/19/facts/1/label": "Executable version", "/versions/19/facts/2/label": "Reference inventory", "/versions/19/facts/2/value": "Client applications", "/versions/19/facts/3/label": "Option definition groups", "/versions/19/tables/0/title": "Documented options", "/versions/19/tables/1/title": "Environment variables", "/versions/19/related/0/label": "libpq connection parameters", "/versions/19/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped.", "/versions/19/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is.", "/versions/19/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/19/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/19/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/19/tables/0/rows/5/summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "/versions/19/tables/0/rows/6/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "/versions/19/tables/0/rows/7/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump unless the directory exists and is empty.", "/versions/19/tables/0/rows/8/summary": "Selects the format of the output. format can be one of the following:", "/versions/19/tables/0/rows/9/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/19/tables/0/columns/0/label": "Option and arguments", "/versions/19/tables/0/columns/1/label": "Description", "/versions/19/tables/0/rows/10/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/19/tables/0/rows/11/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/19/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/19/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/19/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data or statistics.", "/versions/19/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/19/tables/0/rows/16/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/19/tables/0/rows/17/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/19/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/19/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/19/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/19/tables/0/rows/21/summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "/versions/19/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/19/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/19/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/19/tables/0/rows/25/summary": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/19/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/19/tables/0/rows/27/summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "/versions/19/tables/0/rows/28/summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/19/tables/0/rows/29/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/19/tables/0/rows/30/summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/19/tables/0/rows/31/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/19/tables/0/rows/32/summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "/versions/19/tables/0/rows/33/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/19/tables/0/rows/34/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/19/tables/0/rows/35/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/19/tables/0/rows/36/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/19/tables/0/rows/37/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/19/tables/0/rows/38/summary": "Do not dump COMMENT commands.", "/versions/19/tables/0/rows/39/summary": "Do not dump data.", "/versions/19/tables/0/rows/40/summary": "Do not dump row security policies.", "/versions/19/tables/0/rows/41/summary": "Do not dump publications.", "/versions/19/tables/0/rows/42/summary": "Do not dump schema (data definitions).", "/versions/19/tables/0/rows/43/summary": "Do not dump security labels.", "/versions/19/tables/0/rows/44/summary": "Do not dump statistics. This is the default.", "/versions/19/tables/0/rows/45/summary": "Do not dump subscriptions.", "/versions/19/tables/0/rows/46/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/19/tables/0/rows/47/summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "/versions/19/tables/0/rows/48/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/19/tables/0/rows/49/summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "/versions/19/tables/0/rows/50/summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "/versions/19/tables/0/rows/51/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/19/tables/0/rows/52/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/19/tables/0/rows/53/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/19/tables/0/rows/54/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/19/tables/0/rows/55/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/19/tables/0/rows/56/summary": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.", "/versions/19/tables/0/rows/57/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/19/tables/0/rows/58/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.101 for more details).", "/versions/19/tables/0/rows/59/summary": "Dump optimizer statistics.", "/versions/19/tables/0/rows/60/summary": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.", "/versions/19/tables/0/rows/61/summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "/versions/19/tables/0/rows/62/summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "/versions/19/tables/0/rows/63/summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/19/tables/0/rows/64/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/19/tables/0/rows/65/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/19/tables/0/rows/66/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/19/tables/0/rows/67/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/19/tables/0/rows/68/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/19/tables/0/rows/69/summary": "User name to connect as.", "/versions/19/tables/0/rows/70/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/19/tables/0/rows/71/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/19/tables/0/rows/72/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/19/tables/1/columns/0/label": "Variable", "/versions/19/tables/1/columns/1/label": "Meaning", "/versions/19/tables/1/rows/0/description": "Default connection parameters.", "/versions/19/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .", "/versions/19/tables/0/rows/1/signature/text": "-b --large-objects --blobs (deprecated)", "/versions/19/tables/0/rows/2/signature/text": "-B --no-large-objects --no-blobs (deprecated)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "6d07236a089a5423024215665a14d8a889f3b863b8e83c557df81b2ce31d2795"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "signature": "-b --large-objects --blobs (deprecated)", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "signature": "-B --no-large-objects --no-blobs (deprecated)", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "signature": "-e pattern --extension= pattern", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note pg_dump does not dump the extension's underlying installation files (such as shared libraries or control files). These must be available on the destination system for the restore to succeed."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump unless the directory exists and is empty."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data or statistics. This option cannot be used with --data-only or --statistics-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "signature": "--exclude-extension= pattern", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "signature": "--exclude-table-and-children= pattern", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only or --statistics-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "signature": "--exclude-table-data-and-children= pattern", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "signature": "--filter= filename", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump COMMENT commands."}, {"names": ["--no-data"], "signature": "--no-data", "description": "Do not dump data."}, {"names": ["--no-policies"], "signature": "--no-policies", "description": "Do not dump row security policies."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-schema"], "signature": "--no-schema", "description": "Do not dump schema (data definitions)."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-statistics"], "signature": "--no-statistics", "description": "Do not dump statistics. This is the default."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "signature": "--no-table-access-method", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "signature": "--no-toast-compression", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items."}, {"names": ["--sequence-data"], "signature": "--sequence-data", "description": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.101 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--statistics"], "signature": "--statistics", "description": "Dump optimizer statistics."}, {"names": ["--statistics-only"], "signature": "--statistics-only", "description": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "signature": "--table-and-children= pattern", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "49d8bd5ff303805fbeaed2fd55253ee4b480846687aa14e5b3d4b768c6d653c0", "manual_language": "zh"}, "20": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "20devel"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "73"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u7edf\u8ba1\u4fe1\u606f\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u3001 --schema-only \u3001 --statistics-only \u6216 --no-data \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u518d\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u6216 --statistics-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-b --large-objects --blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-B --no-large-objects --no-blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u4ec5\u8f6c\u50a8\u4e0e pattern \u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -e \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-e pattern --extension= pattern"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728 \u7b2c 23.3.1 \u8282 \u4e2d\u63cf\u8ff0\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u9664\u975e\u8be5\u76ee\u5f55\u5df2\u5b58\u5728\u4e14\u4e3a\u7a7a\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u6216\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a gzip \u3001 lz4 \u3001 zstd \u6216 none \uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 keyword \u6216 keyword=value \u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f level \u548c long \u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4\uff08 INSERT INTO table ( column , ...) VALUES ... \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u5305\u542b\u6570\u636e\u4f46\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -e \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-extension \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--exclude-extension= pattern"}}, {"summary": "\u8fd9\u4e0e -T / --exclude-table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--exclude-table-and-children= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u8fd9\u4e0e --exclude-table-data \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--exclude-table-data-and-children= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 -t / --table \u3001 --table-and-children \u3001 -T / --exclude-table \u548c --exclude-table-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 -n / --schema \u548c -N / --exclude-schema \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 --include-foreign-data \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 --exclude-table-data \u548c --exclude-table-data-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 -e / --extension \u548c --exclude-extension \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece STDIN \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 - \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002 --filter \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--filter= filename"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8 COMMENT \u547d\u4ee4\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-data"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u884c\u5b89\u5168\u6027\u7b56\u7565\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-policies"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-schema"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-statistics"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-table-access-method"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e TOAST \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-toast-compression"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5e8f\u5217\u6570\u636e\u3002\u9664\u975e\u6307\u5b9a\u4e86 --no-data \u3001 --schema-only \u6216 --statistics-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--sequence-data"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.102 \uff09\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8f6c\u50a8\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--statistics"}}, {"summary": "\u53ea\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u6570\u636e\u3002\u4f1a\u8f6c\u50a8\u8868\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u7d22\u5f15\u7684\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--statistics-only"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08 -e / --extension \uff09\u3001\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 --filter \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 pg_dump \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 --strict-names \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u5f53\u8bbe\u4e3a fsync \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c pg_dump --format=directory \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--sync-method= method"}}, {"summary": "\u8fd9\u4e0e -t / --table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--table-and-children= pattern"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/devel/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is.", "signature": "-b --large-objects --blobs (deprecated)", "source_url": "/docs/devel/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-large-objects --no-blobs (deprecated)", "source_url": "/docs/devel/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/devel/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/devel/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "signature": "-e pattern --extension= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note pg_dump does not dump the extension's underlying installation files (such as shared libraries or control files). These must be available on the destination system for the restore to succeed."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/devel/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump unless the directory exists and is empty.", "signature": "-f file --file= file", "source_url": "/docs/devel/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump unless the directory exists and is empty."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/devel/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/devel/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/devel/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data or statistics.", "signature": "-s --schema-only", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump only the object definitions (schema), not data or statistics. This option cannot be used with --data-only or --statistics-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/devel/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/devel/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/devel/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/devel/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "source_url": "/docs/devel/app-pgdump.html", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/devel/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/devel/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/devel/app-pgdump.html", "description": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/devel/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "signature": "--exclude-extension= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-and-children= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only or --statistics-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-data-and-children= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/devel/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "signature": "--filter= filename", "source_url": "/docs/devel/app-pgdump.html", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/devel/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/devel/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump COMMENT commands.", "signature": "--no-comments", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump COMMENT commands."}, {"names": ["--no-data"], "summary": "Do not dump data.", "signature": "--no-data", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump data."}, {"names": ["--no-policies"], "summary": "Do not dump row security policies.", "signature": "--no-policies", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump row security policies."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-schema"], "summary": "Do not dump schema (data definitions).", "signature": "--no-schema", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump schema (data definitions)."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-statistics"], "summary": "Do not dump statistics. This is the default.", "signature": "--no-statistics", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump statistics. This is the default."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/devel/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "signature": "--no-table-access-method", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "signature": "--no-toast-compression", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/devel/app-pgdump.html", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/devel/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/devel/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/devel/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/devel/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items."}, {"names": ["--sequence-data"], "summary": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.", "signature": "--sequence-data", "source_url": "/docs/devel/app-pgdump.html", "description": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/devel/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.102 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/devel/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.102 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--statistics"], "summary": "Dump optimizer statistics.", "signature": "--statistics", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump optimizer statistics."}, {"names": ["--statistics-only"], "summary": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.", "signature": "--statistics-only", "source_url": "/docs/devel/app-pgdump.html", "description": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."}, {"names": ["--strict-names"], "summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/devel/app-pgdump.html", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "signature": "--sync-method= method", "source_url": "/docs/devel/app-pgdump.html", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--table-and-children= pattern", "source_url": "/docs/devel/app-pgdump.html", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/devel/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/devel/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/devel/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/devel/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/devel/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/devel/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/devel/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/devel/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/devel/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=20", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "label": "20devel", "major": "20", "channel": "devel", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/20/postgresql-20-A4.pdf", "bytes": 16030631, "pages": 3052, "sha256": "bd5d82c0ce38fc18f92a0447818a91a193a261776bca1c37564bf9a683e177d0", "built_at": "2026-09-28"}, "US": {"url": "/files/documentation/pdf/20/postgresql-20-US.pdf", "bytes": 15936613, "pages": 3223, "sha256": "d97d9e0db479a02f4234b175f50fcad70c3661619afc8d6df9b9437882e3c299", "built_at": "2026-09-28"}}, "tree": "0", "index": "index.html", "major": "20", "pages": 1156, "release": "20devel", "source_url": "https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.bz2", "svg_assets": 6, "source_mode": "en SGML built with pinned official archive", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41", "source_snapshot_utc": "26-Sep-2026 20:22"}, "revision": "2eba5e0fd4c3bffb2803247b6cd537878e9d6ee5a6dfbe3c50ece8b421b80918", "evidence_kind": "English manual and source declarations", "source_sha256": "4d3346909b201ac1648232cf290462a7070c119326f56196f1f0253ed80fae41"}, "sources": [{"url": "https://pg.center/docs/devel/app-pgdump.html", "file": "app-pgdump.html", "label": "20devel English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "4e1f336a3eb075e3f20f40e8e31409b35036feeea65b4aa449f53bd194cf20c0", "language": "en", "original_url": "/docs/devel/app-pgdump.html"}, {"url": "https://pg.center/docs/devel/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "a6c7ba748fa1d9feac5bb7cde41d1d36a1f4c26d5963e07fb103d02918b2a8ca", "language": "en", "original_url": "/docs/devel/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06 PostgreSQL \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_dump</span></span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06 <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.14.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u662f\u4e00\u4e2a\u7528\u4e8e\u5bfc\u51fa <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5bfc\u51fa\u7ed3\u679c\u3002<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u9664\u4e86\u7b80\u5355\u573a\u666f\u4e4b\u5916\uff0c<span class=\"application\">pg_dump</span> \u901a\u5e38\u5e76\u4e0d\u662f\u5bf9\u751f\u4ea7\u6570\u636e\u5e93\u8fdb\u884c\u5e38\u89c4\u5907\u4efd\u7684\u6b63\u786e\u9009\u62e9\u3002\u8fdb\u4e00\u6b65\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/devel/backup.html\" title=\"\u7b2c\u00a025\u00a0\u7ae0\u00a0\u5907\u4efd\u548c\u6062\u590d\">\u7b2c\u00a025\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5bfc\u51fa\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5bfc\u51fa\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/devel/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/devel/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/devel/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5bfc\u51fa\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u7edf\u8ba1\u4fe1\u606f\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u3001<code class=\"option\">--schema-only</code>\u3001<code class=\"option\">--statistics-only</code> \u6216 <code class=\"option\">--no-data</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code> \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u518d\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 <code class=\"option\">--data-only</code> \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 <code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code> \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u4e0e<em class=\"replaceable\"><code>pattern</code></em>\u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a<code class=\"option\">-e</code>\u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002</p>\n<p lang=\"zh\">\u7531 <code class=\"function\">pg_extension_config_dump</code> \u6ce8\u518c\u7684\u4efb\u4f55\u914d\u7f6e\u5173\u7cfb\uff0c\u5982\u679c\u5176\u6240\u5c5e\u6269\u5c55\u7531 <code class=\"option\">--extension</code> \u6307\u5b9a\uff0c\u4e5f\u4f1a\u5305\u542b\u5728\u8f6c\u50a8\u4e2d\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u8f6c\u50a8\u6269\u5c55\u7684\u5e95\u5c42\u5b89\u88c5\u6587\u4ef6\uff08\u4f8b\u5982\u5171\u4eab\u5e93\u6216\u63a7\u5236\u6587\u4ef6\uff09\u3002\u8981\u5728\u76ee\u6807\u7cfb\u7edf\u4e0a\u6210\u529f\u6062\u590d\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5fc5\u987b\u53ef\u7528\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728<a class=\"xref\" href=\"/docs/devel/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" title=\"23.3.1.\u00a0\u652f\u6301\u7684\u5b57\u7b26\u96c6\">\u7b2c\u00a023.3.1\u00a0\u8282</a>\u4e2d\u63cf\u8ff0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u9664\u975e\u8be5\u76ee\u5f55\u5df2\u5b58\u5728\u4e14\u4e3a\u7a7a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u4f7f\u7528 <code class=\"literal\">gzip</code> \u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/devel/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u9886\u5bfc\u8005\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff08<a class=\"link\" href=\"/docs/devel/explicit-locking.html#LOCKING-TABLES\" title=\"13.3.1.\u00a0\u8868\u7ea7\u9501\">ACCESS SHARE</a>\uff09\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u9886\u5bfc\u8005\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/devel/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--large-objects</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u6216\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--data-only</code> \u6216 <code class=\"option\">--statistics-only</code> \u4e00\u8d77\u4f7f\u7528\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/devel/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]<br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]</span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a <code class=\"literal\">gzip</code>\u3001<code class=\"literal\">lz4</code>\u3001<code class=\"literal\">zstd</code> \u6216 <code class=\"literal\">none</code>\uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 <code class=\"literal\">keyword</code> \u6216 <code class=\"literal\">keyword=value</code>\u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f <code class=\"literal\">level</code> \u548c <code class=\"literal\">long</code>\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u672a\u6307\u5b9a\u538b\u7f29\u7ea7\u522b\uff0c\u5c06\u4f7f\u7528\u9ed8\u8ba4\u7ea7\u522b\u3002\u5982\u679c\u53ea\u6307\u5b9a\u7ea7\u522b\u800c\u672a\u6307\u5b9a\u7b97\u6cd5\uff0c\u5219\u7ea7\u522b\u5927\u4e8e 0 \u65f6\u4f7f\u7528 gzip \u538b\u7f29\uff0c\u7ea7\u522b\u4e3a 0 \u65f6\u4e0d\u538b\u7f29\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e custom \u548c directory \u5f52\u6863\u683c\u5f0f\uff0c\u6b64\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u662f\u4f7f\u7528\u4e2d\u7b49\u7ea7\u522b\u7684 <code class=\"literal\">gzip</code> \u8fdb\u884c\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\u88ab\u538b\u7f29\uff0c\u5c31\u50cf\u5b83\u7ecf\u8fc7\u4e86 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u662f\u4e0d\u538b\u7f29\u3002\u4f7f\u7528 zstd \u538b\u7f29\u65f6\uff0c<code class=\"literal\">long</code> \u6a21\u5f0f\u53ef\u80fd\u63d0\u9ad8\u538b\u7f29\u6bd4\uff0c\u4f46\u4ee3\u4ef7\u662f\u5185\u5b58\u4f7f\u7528\u589e\u52a0\u3002</p>\n<p lang=\"zh\">tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u5305\u542b\u6570\u636e\u4f46\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/devel/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/devel/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-e</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-extension</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-e</code> \u548c <code class=\"option\">--exclude-extension</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-e</code> \u5f00\u5173\u3001\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">--exclude-extension</code> \u5f00\u5173\u7684\u6269\u5c55\u3002\u5982\u679c <code class=\"option\">--exclude-extension</code> \u5728\u6ca1\u6709 <code class=\"option\">-e</code> \u7684\u60c5\u51b5\u4e0b\u51fa\u73b0\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">--exclude-extension</code> \u7684\u6269\u5c55\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u82e5\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--filter=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 <code class=\"option\">-t</code>/<code class=\"option\">--table</code>\u3001<code class=\"option\">--table-and-children</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u548c <code class=\"option\">--exclude-table-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u548c <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--exclude-table-data</code> \u548c <code class=\"option\">--exclude-table-data-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u548c <code class=\"option\">--exclude-extension</code> \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece <code class=\"literal\">STDIN</code> \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 <code class=\"filename\">-</code> \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002<code class=\"option\">--filter</code> \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002</p>\n<p lang=\"zh\">\u6587\u4ef6\u6bcf\u884c\u5217\u51fa\u4e00\u4e2a\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a</p>\n<pre class=\"synopsis\">{ include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } <em class=\"replaceable\"><code>PATTERN</code></em>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e00\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u662f\u5305\u542b\u8fd8\u662f\u6392\u9664\u4e0e\u6a21\u5f0f\u5339\u914d\u7684\u5bf9\u8c61\u3002\u7b2c\u4e8c\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u8981\u7528\u8be5\u6a21\u5f0f\u8fc7\u6ee4\u7684\u5bf9\u8c61\u7c7b\u578b\uff1a</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">extension</code>\uff1a\u6269\u5c55\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u6216 <code class=\"option\">--exclude-extension</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">foreign_data</code>\uff1a\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--include-foreign-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">include</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table</code>\uff1a\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u6216 <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_and_children</code>\uff1a\u8868\uff0c\u4ee5\u53ca\u5176\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--table-and-children</code> \u6216 <code class=\"option\">--exclude-table-and-children</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data_and_children</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\uff0c\u4ee5\u53ca\u8fd9\u4e9b\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data-and-children</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">schema</code>\uff1a\u6a21\u5f0f\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u6216 <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u9009\u9879\u3002</p>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u4ee5 <code class=\"literal\">#</code> \u5f00\u5934\u7684\u884c\u88ab\u89c6\u4e3a\u6ce8\u91ca\u5e76\u5ffd\u7565\u3002\u6ce8\u91ca\u4e5f\u53ef\u4ee5\u653e\u5728\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u884c\u4e4b\u540e\u3002\u7a7a\u767d\u884c\u540c\u6837\u4f1a\u88ab\u5ffd\u7565\u3002\u6709\u5173\u5982\u4f55\u5728\u5339\u914d\u6a21\u5f0f\u4e2d\u52a0\u5f15\u53f7\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\u3002</p>\n<p lang=\"zh\">\u793a\u4f8b\u6587\u4ef6\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/devel/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u4e00\u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/devel/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8 <code class=\"command\">COMMENT</code> \u547d\u4ee4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-policies</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u884c\u5b89\u5168\u6027\u7b56\u7565\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-schema</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-statistics</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-table-access-method</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-toast-compression</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e <acronym class=\"acronym\">TOAST</acronym> \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">\u6570\u636e\u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u3001\u5e8f\u5217\u503c\uff0c\u4ee5\u53ca\u8868\u3001\u7269\u5316\u89c6\u56fe\u548c\u5916\u90e8\u8868\u7684\u7edf\u8ba1\u4fe1\u606f\u3002post-data \u90e8\u5206\u5305\u62ec\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\u3001\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u548c\u975e\u7a7a\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u62ec\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sequence-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5e8f\u5217\u6570\u636e\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-data</code>\u3001<code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/devel/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/devel/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.102.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.102</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/devel/logicaldecoding.html\" title=\"\u7b2c\u00a047\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a047\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--statistics</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f6c\u50a8\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--statistics-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u6570\u636e\u3002\u4f1a\u8f6c\u50a8\u8868\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u7d22\u5f15\u7684\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08<code class=\"option\">-e</code>/<code class=\"option\">--extension</code>\uff09\u3001\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 <code class=\"option\">--filter</code> \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 <span class=\"application\">pg_dump</span> \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 <code class=\"option\">--strict-names</code> \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5bf9 <code class=\"option\">--exclude-extension</code>\u3001<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u6216 <code class=\"option\">--exclude-table-data</code> \u6ca1\u6709\u6548\u679c\u3002\u672a\u5339\u914d\u4efb\u4f55\u5bf9\u8c61\u7684\u6392\u9664\u6a21\u5f0f\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f53\u8bbe\u4e3a <code class=\"literal\">fsync</code> \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c<code class=\"command\">pg_dump --format=directory</code> \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002</p>\n<p lang=\"zh\">\u5728 Linux \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u6539\u7528 <code class=\"literal\">syncfs</code>\uff0c\u8ba9\u64cd\u4f5c\u7cfb\u7edf\u540c\u6b65\u5305\u542b\u5f52\u6863\u76ee\u5f55\u7684\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u3002\u5173\u4e8e\u9700\u8981\u6ce8\u610f\u7684\u95ee\u9898\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/devel/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a>\u4e2d\u6709\u5173\u4f7f\u7528 <code class=\"literal\">syncfs</code> \u7684\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u5f53\u4f7f\u7528 <code class=\"option\">--no-sync</code>\uff0c\u6216 <code class=\"option\">--format</code> \u672a\u8bbe\u4e3a <code class=\"literal\">directory</code> \u65f6\uff0c\u6b64\u9009\u9879\u6ca1\u6709\u6548\u679c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/devel/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/devel/libpq-envars.html\" title=\"32.14.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a032.14\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/devel/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-e</code>\u3001<code class=\"option\">-n</code> \u6216 <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u5bf9\u8c61\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u8fd9\u6837\u7684\u8f6c\u50a8\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002\u4f8b\u5982\uff0c\u5982\u679c\u6307\u5b9a\u6062\u590d\u4e00\u4e2a\u5176\u5b9a\u4e49\u5305\u542b\u5916\u952e\u7684\u8868\uff0c\u5219\u4e0d\u4f1a\u81ea\u52a8\u6062\u590d\u8be5\u5916\u952e\u6240\u5f15\u7528\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\">\u521b\u5efa\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u4e0d\u5efa\u8bae\u9650\u5236\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u5bf9\u8c61\u96c6\u5408\uff0c\u800c\u5e94\u5728\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u8bfb\u53d6\u5f52\u6863\u65f6\u518d\u5e94\u7528\u6240\u9700\u7684\u5bf9\u8c61\u8fc7\u6ee4\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u7559\u7075\u6d3b\u6027\uff0c\u5e76\u53ef\u80fd\u907f\u514d\u6062\u590d\u65f6\u51fa\u73b0\u95ee\u9898\uff1b\u8be6\u60c5\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/devel/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6587\u6863\u3002\u7279\u522b\u662f\uff0c\u4e0d\u5efa\u8bae\u5728\u6ca1\u6709\u76f8\u5e94\u8868\u5b9a\u4e49\u7684\u60c5\u51b5\u4e0b\u8f6c\u50a8\u8868\u6570\u636e\uff08\u4f8b\u5982\u901a\u8fc7 <code class=\"option\">--no-schema</code> \u53ca\u76f8\u5173\u9009\u9879\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">--statistics</code> \u65f6\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u5728\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e2d\u5305\u542b\u5927\u591a\u6570\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002\u4f46\u8fd9\u5e76\u4e0d\u5305\u62ec\u6240\u6709\u7edf\u8ba1\u4fe1\u606f\uff0c\u4f8b\u5982\u6269\u5c55\u6dfb\u52a0\u7684\u81ea\u5b9a\u4e49\u7edf\u8ba1\u4fe1\u606f\uff0c\u6216\u7531\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\u518d\u8fd0\u884c <code class=\"command\">ANALYZE</code> \u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff0c\u53ef\u80fd\u4ecd\u7136\u6709\u7528\uff1b\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/devel/routine-vacuuming.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/devel/routine-vacuuming.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 10 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002\u5982\u679c\u7528\u6237\u6253\u7b97\u5728\u5237\u65b0\u671f\u95f4\u590d\u5236\u521d\u59cb\u6570\u636e\uff0c\u5219\u5fc5\u987b\u4ee5 <code class=\"literal\">two_phase = false</code> \u521b\u5efa\u8be5\u69fd\u3002\u521d\u59cb\u540c\u6b65\u4e4b\u540e\uff0c\u8ba2\u9605\u8005\u4f1a\u81ea\u52a8\u542f\u7528 <a class=\"link\" href=\"/docs/devel/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\uff0c\u524d\u63d0\u662f\u8be5\u8ba2\u9605\u6700\u521d\u662f\u4ee5 <code class=\"literal\">two_phase = true</code> \u9009\u9879\u521b\u5efa\u7684\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u628a\u6570\u636e\u5e93 <code class=\"literal\">mydb</code> \u8f6c\u50a8\u5230\u4e00\u4e2a SQL \u811a\u672c\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\uff0c\u5982\u679c\u8981\u6307\u5b9a\u4e00\u4e2a\u5927\u5199\u6216\u6df7\u5408\u5927\u5c0f\u5199\u7684\u540d\u79f0\uff0c\u5c31\u9700\u8981\u5bf9\u8be5\u540d\u79f0\u52a0\u53cc\u5f15\u53f7\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u6210\u5c0f\u5199\uff08\u89c1<a class=\"xref\" href=\"/docs/devel/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6765\u8bf4\u53c8\u662f\u7279\u6b8a\u5b57\u7b26\uff0c\u56e0\u6b64\u53cd\u8fc7\u6765\u8fd8\u5fc5\u987b\u518d\u88ab\u5f15\u7528\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u5177\u6709\u6df7\u5408\u5927\u5c0f\u5199\u540d\u79f0\u7684\u5355\u4e2a\u8868\uff0c\u9700\u8981\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u6240\u6709\u540d\u79f0\u4ee5 <code class=\"literal\">mytable</code> \u5f00\u5934\u3001\u4f46\u6392\u9664 <code class=\"structname\">mytable2</code> \u8868\u7684\u8868\uff0c\u8bf7\u6307\u5b9a\u5982\u4e0b\u8fc7\u6ee4\u6587\u4ef6 <code class=\"filename\">filter.txt</code>\uff1a</p>\n<pre class=\"programlisting\">include table mytable*\nexclude table mytable2\n</pre>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump --filter=filter.txt mydb &gt; db.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/devel/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/devel/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/devel/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/devel/app-pgdump.html", "method": "same-major semantic node", "sha256": "672b427fd8f293512b98e8262851363bc83077a19ca601ab4a4d3b59810fedbe", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[111]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[115]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[121]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[123]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[125]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[125]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[129]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[131]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[133]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[6]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[8]/p[8]", "#APP-PGDUMP/div[8]/p[9]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[27]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/summary": "pg_dump \u2014 export a PostgreSQL database as an SQL script or to other formats", "/category": "Client applications", "/versions/20/description/0": "pg_dump \u2014 export a PostgreSQL database as an SQL script or to other formats", "/versions/20/facts/0/label": "Documented executable", "/versions/20/facts/1/label": "Executable version", "/versions/20/facts/2/label": "Reference inventory", "/versions/20/facts/2/value": "Client applications", "/versions/20/facts/3/label": "Option definition groups", "/versions/20/tables/0/title": "Documented options", "/versions/20/tables/1/title": "Environment variables", "/versions/20/related/0/label": "libpq connection parameters", "/versions/20/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped.", "/versions/20/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is.", "/versions/20/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/20/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/20/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/20/tables/0/rows/5/summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "/versions/20/tables/0/rows/6/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "/versions/20/tables/0/rows/7/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump unless the directory exists and is empty.", "/versions/20/tables/0/rows/8/summary": "Selects the format of the output. format can be one of the following:", "/versions/20/tables/0/rows/9/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/20/tables/0/columns/0/label": "Option and arguments", "/versions/20/tables/0/columns/1/label": "Description", "/versions/20/tables/0/rows/10/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/20/tables/0/rows/11/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/20/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/20/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/20/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data or statistics.", "/versions/20/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/20/tables/0/rows/16/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/20/tables/0/rows/17/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/20/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/20/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/20/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/20/tables/0/rows/21/summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "/versions/20/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/20/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/20/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/20/tables/0/rows/25/summary": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/20/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/20/tables/0/rows/27/summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "/versions/20/tables/0/rows/28/summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/20/tables/0/rows/29/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/20/tables/0/rows/30/summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/20/tables/0/rows/31/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/20/tables/0/rows/32/summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "/versions/20/tables/0/rows/33/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/20/tables/0/rows/34/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/20/tables/0/rows/35/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/20/tables/0/rows/36/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/20/tables/0/rows/37/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/20/tables/0/rows/38/summary": "Do not dump COMMENT commands.", "/versions/20/tables/0/rows/39/summary": "Do not dump data.", "/versions/20/tables/0/rows/40/summary": "Do not dump row security policies.", "/versions/20/tables/0/rows/41/summary": "Do not dump publications.", "/versions/20/tables/0/rows/42/summary": "Do not dump schema (data definitions).", "/versions/20/tables/0/rows/43/summary": "Do not dump security labels.", "/versions/20/tables/0/rows/44/summary": "Do not dump statistics. This is the default.", "/versions/20/tables/0/rows/45/summary": "Do not dump subscriptions.", "/versions/20/tables/0/rows/46/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/20/tables/0/rows/47/summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "/versions/20/tables/0/rows/48/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/20/tables/0/rows/49/summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "/versions/20/tables/0/rows/50/summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "/versions/20/tables/0/rows/51/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/20/tables/0/rows/52/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/20/tables/0/rows/53/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/20/tables/0/rows/54/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/20/tables/0/rows/55/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/20/tables/0/rows/56/summary": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.", "/versions/20/tables/0/rows/57/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/20/tables/0/rows/58/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.102 for more details).", "/versions/20/tables/0/rows/59/summary": "Dump optimizer statistics.", "/versions/20/tables/0/rows/60/summary": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.", "/versions/20/tables/0/rows/61/summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "/versions/20/tables/0/rows/62/summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "/versions/20/tables/0/rows/63/summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/20/tables/0/rows/64/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/20/tables/0/rows/65/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/20/tables/0/rows/66/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/20/tables/0/rows/67/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/20/tables/0/rows/68/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/20/tables/0/rows/69/summary": "User name to connect as.", "/versions/20/tables/0/rows/70/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/20/tables/0/rows/71/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/20/tables/0/rows/72/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/20/tables/1/columns/0/label": "Variable", "/versions/20/tables/1/columns/1/label": "Meaning", "/versions/20/tables/1/rows/0/description": "Default connection parameters.", "/versions/20/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .", "/versions/20/tables/0/rows/1/signature/text": "-b --large-objects --blobs (deprecated)", "/versions/20/tables/0/rows/2/signature/text": "-B --no-large-objects --no-blobs (deprecated)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "58812edbaf37d3c50f6bacd84f696c77242ab57c1d6f9d39bacbea34c1e786d9"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "signature": "-b --large-objects --blobs (deprecated)", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "signature": "-B --no-large-objects --no-blobs (deprecated)", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "signature": "-e pattern --extension= pattern", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note pg_dump does not dump the extension's underlying installation files (such as shared libraries or control files). These must be available on the destination system for the restore to succeed."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump unless the directory exists and is empty."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data or statistics. This option cannot be used with --data-only or --statistics-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "signature": "--exclude-extension= pattern", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "signature": "--exclude-table-and-children= pattern", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only or --statistics-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "signature": "--exclude-table-data-and-children= pattern", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "signature": "--filter= filename", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump COMMENT commands."}, {"names": ["--no-data"], "signature": "--no-data", "description": "Do not dump data."}, {"names": ["--no-policies"], "signature": "--no-policies", "description": "Do not dump row security policies."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-schema"], "signature": "--no-schema", "description": "Do not dump schema (data definitions)."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-statistics"], "signature": "--no-statistics", "description": "Do not dump statistics. This is the default."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "signature": "--no-table-access-method", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "signature": "--no-toast-compression", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items."}, {"names": ["--sequence-data"], "signature": "--sequence-data", "description": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.102 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--statistics"], "signature": "--statistics", "description": "Dump optimizer statistics."}, {"names": ["--statistics-only"], "signature": "--statistics-only", "description": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "signature": "--table-and-children= pattern", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "6b1c1461065aa18057502ef22a697f55b0a0f1c3b804c1deb84189fe09b714d7", "manual_language": "zh"}}}, "snapshot": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_dump"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "18.6"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u5ba2\u6237\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "73"}], "tables": [{"key": "options", "rows": [{"summary": "\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u7edf\u8ba1\u4fe1\u606f\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-a --data-only"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 --schema \u3001 --table \u3001 --schema-only \u3001 --statistics-only \u6216 --no-data \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c -b \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u518d\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 --data-only \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 --schema-only \u6216 --statistics-only \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-b --large-objects --blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-B --no-large-objects --no-blobs \uff08\u5df2\u5f03\u7528\uff09"}}, {"summary": "\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e DROP \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 --if-exists \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-c --clean"}}, {"summary": "\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 --clean \uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-C --create"}}, {"summary": "\u4ec5\u8f6c\u50a8\u4e0e pattern \u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -e \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-e pattern --extension= pattern"}}, {"summary": "\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06 PGCLIENTENCODING \u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728 \u7b2c 23.3.1 \u8282 \u4e2d\u63cf\u8ff0\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-E encoding --encoding= encoding"}}, {"summary": "\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 pg_dump \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-f file --file= file"}}, {"summary": "\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002 format \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-F format --format= format"}}, {"summary": "\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 njobs \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-j njobs --jobs= njobs"}}, {"summary": "\u53ea\u8f6c\u50a8\u5339\u914d pattern \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -n \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-n pattern --schema= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -n \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -N \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-N pattern --exclude-schema= pattern"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u53d1\u51fa ALTER OWNER \u6216 SET SESSION AUTHORIZATION \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a -O \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-O --no-owner"}}, {"summary": "\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-R --no-reconnect"}}, {"summary": "\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u6216\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-s --schema-only"}}, {"summary": "\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 --disable-triggers \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-S username --superuser= username"}}, {"summary": "\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d pattern \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a -t \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002 pattern \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-t pattern --table= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 -T \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-T pattern --exclude-table= pattern"}}, {"summary": "\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f pg_dump \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-v --verbose"}}, {"summary": "\u6253\u5370 pg_dump \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-V --version"}}, {"summary": "\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-x --no-privileges --no-acl"}}, {"summary": "\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a gzip \u3001 lz4 \u3001 zstd \u6216 none \uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 keyword \u6216 keyword=value \u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f level \u548c long \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]"}}, {"summary": "\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--binary-upgrade"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684 INSERT \u547d\u4ee4\uff08 INSERT INTO table ( column , ...) VALUES ... \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--column-inserts --attribute-inserts"}}, {"summary": "\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--disable-dollar-quoting"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u5305\u542b\u6570\u636e\u4f46\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a pg_dump \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--disable-triggers"}}, {"summary": "\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u5c06 row_security \u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a pg_dump \u6539\u4e3a\u5c06 row_security \u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--enable-row-security"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -e \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-extension \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--exclude-extension= pattern"}}, {"summary": "\u8fd9\u4e0e -T / --exclude-table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--exclude-table-and-children= pattern"}}, {"summary": "\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d pattern \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e -t \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002 --exclude-table-data \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--exclude-table-data= pattern"}}, {"summary": "\u8fd9\u4e0e --exclude-table-data \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--exclude-table-data-and-children= pattern"}}, {"summary": "\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 extra_float_digits \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--extra-float-digits= ndigits"}}, {"summary": "\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 -t / --table \u3001 --table-and-children \u3001 -T / --exclude-table \u548c --exclude-table-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 -n / --schema \u548c -N / --exclude-schema \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 --include-foreign-data \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 --exclude-table-data \u548c --exclude-table-data-and-children \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 -e / --extension \u548c --exclude-extension \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece STDIN \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 - \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002 --filter \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--filter= filename"}}, {"summary": "\u4f7f\u7528 DROP ... IF EXISTS \u547d\u4ee4\u5728 --clean \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684 \u201c does not exist \u201d \u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --clean \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--if-exists"}}, {"summary": "\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d foreignserver \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a --include-foreign-data \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c foreignserver \u53c2\u6570\u6309\u7167 psql \u7684 \\d \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1 \u6a21\u5f0f \uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684 \u793a\u4f8b \u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--include-foreign-data= foreignserver"}}, {"summary": "\u628a\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e PostgreSQL \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 INSERT \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002 --column-inserts \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--inserts"}}, {"summary": "\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 COPY \u6216 INSERT \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--load-via-partition-root"}}, {"summary": "\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 timeout \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 SET statement_timeout \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--lock-wait-timeout= timeout"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8 COMMENT \u547d\u4ee4\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-comments"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u6570\u636e\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-data"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u884c\u5b89\u5168\u6027\u7b56\u7565\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-policies"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-publications"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-schema"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-security-labels"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-statistics"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-subscriptions"}}, {"summary": "\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f pg_dump \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-sync"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-table-access-method"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-tablespaces"}}, {"summary": "\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e TOAST \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-toast-compression"}}, {"summary": "\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--no-unlogged-table-data"}}, {"summary": "\u6dfb\u52a0 ON CONFLICT DO NOTHING \u5230 INSERT \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 --inserts \u3001 --column-inserts \u6216 --rows-per-insert \uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--on-conflict-do-nothing"}}, {"summary": "\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 PostgreSQL \u4e3b\u7248\u672c\u4e0e pg_dump \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c pg_dump \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 --quote-all-identifiers \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--quote-all-identifiers"}}, {"summary": "\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c psql \u7684 \\restrict \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f --format \u88ab\u8bbe\u7f6e\u4e3a plain \uff0c\u6216\u8005\u7701\u7565\u4e86 --format \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c pg_dump \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--restrict-key= restrict_key"}}, {"summary": "\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a INSERT \u547d\u4ee4\uff08\u800c\u4e0d\u662f COPY \uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a INSERT \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 INSERT \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--rows-per-insert= nrows"}}, {"summary": "\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f pre-data \u3001 data \u6216 post-data \u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--section= sectionname"}}, {"summary": "\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5e8f\u5217\u6570\u636e\u3002\u9664\u975e\u6307\u5b9a\u4e86 --no-data \u3001 --schema-only \u6216 --statistics-only \uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--sequence-data"}}, {"summary": "\u4f7f\u7528 serializable \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 serialization_failure \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 \u7b2c 13 \u7ae0 \u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--serializable-deferrable"}}, {"summary": "\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1 \u8868 9.100 \uff09\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--snapshot= snapshotname"}}, {"summary": "\u8f6c\u50a8\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--statistics"}}, {"summary": "\u53ea\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u6570\u636e\u3002\u4f1a\u8f6c\u50a8\u8868\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u7d22\u5f15\u7684\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--statistics-only"}}, {"summary": "\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08 -e / --extension \uff09\u3001\u6a21\u5f0f\uff08 -n / --schema \uff09\u548c\u8868\uff08 -t / --table \uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 --filter \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 pg_dump \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 --strict-names \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--strict-names"}}, {"summary": "\u5f53\u8bbe\u4e3a fsync \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c pg_dump --format=directory \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--sync-method= method"}}, {"summary": "\u8fd9\u4e0e -t / --table \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d pattern \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--table-and-children= pattern"}}, {"summary": "\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 SET SESSION AUTHORIZATION \u547d\u4ee4\uff0c\u800c\u4e0d\u662f ALTER OWNER \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 SET SESSION AUTHORIZATION \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c ALTER OWNER \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--use-set-session-authorization"}}, {"summary": "\u663e\u793a\u5173\u4e8e pg_dump \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a dbname \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002 dbname \u53ef\u4ee5\u662f \u8fde\u63a5\u5b57\u7b26\u4e32 \u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-d dbname --dbname= dbname"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGHOST \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-h host --host= host"}}, {"summary": "\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-p port --port= port"}}, {"summary": "\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-U username --username= username"}}, {"summary": "\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 .pgpass \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-w --no-password"}}, {"summary": "\u5f3a\u5236 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "-W --password"}}, {"summary": "\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 pg_dump \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa SET ROLE rolename \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 -U \u6307\u5b9a\uff09\u7f3a\u5c11 pg_dump \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002", "signature": {"url": "/docs/18/app-pgdump.html", "text": "--role= rolename"}}], "title": "\u624b\u518c\u4e2d\u7684\u9009\u9879", "columns": [{"key": "signature", "label": "\u9009\u9879\u4e0e\u53c2\u6570"}, {"key": "summary", "label": "\u8bf4\u660e"}]}, {"key": "environment", "rows": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002"}, {"name": "PG_COLOR", "description": "\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a always \u3001 auto \u548c never \u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-a", "--data-only"], "summary": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped.", "signature": "-a --data-only", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is.", "signature": "-b --large-objects --blobs (deprecated)", "source_url": "/docs/18/app-pgdump.html", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "summary": "Exclude large objects in the dump.", "signature": "-B --no-large-objects --no-blobs (deprecated)", "source_url": "/docs/18/app-pgdump.html", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "signature": "-c --clean", "source_url": "/docs/18/app-pgdump.html", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "signature": "-C --create", "source_url": "/docs/18/app-pgdump.html", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "signature": "-e pattern --extension= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "signature": "-E encoding --encoding= encoding", "source_url": "/docs/18/app-pgdump.html", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "signature": "-f file --file= file", "source_url": "/docs/18/app-pgdump.html", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "summary": "Selects the format of the output. format can be one of the following:", "signature": "-F format --format= format", "source_url": "/docs/18/app-pgdump.html", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "signature": "-j njobs --jobs= njobs", "source_url": "/docs/18/app-pgdump.html", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-n pattern --schema= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "signature": "-N pattern --exclude-schema= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "signature": "-O --no-owner", "source_url": "/docs/18/app-pgdump.html", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "summary": "This option is obsolete but still accepted for backwards compatibility.", "signature": "-R --no-reconnect", "source_url": "/docs/18/app-pgdump.html", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "summary": "Dump only the object definitions (schema), not data or statistics.", "signature": "-s --schema-only", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only the object definitions (schema), not data or statistics. This option cannot be used with --data-only or --statistics-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "signature": "-S username --superuser= username", "source_url": "/docs/18/app-pgdump.html", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "signature": "-t pattern --table= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "signature": "-T pattern --exclude-table= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "signature": "-v --verbose", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "summary": "Print the pg_dump version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pgdump.html", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "summary": "Prevent dumping of access privileges (grant/revoke commands).", "signature": "-x --no-privileges --no-acl", "source_url": "/docs/18/app-pgdump.html", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "source_url": "/docs/18/app-pgdump.html", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "signature": "--binary-upgrade", "source_url": "/docs/18/app-pgdump.html", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--column-inserts --attribute-inserts", "source_url": "/docs/18/app-pgdump.html", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "signature": "--disable-dollar-quoting", "source_url": "/docs/18/app-pgdump.html", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "summary": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "signature": "--disable-triggers", "source_url": "/docs/18/app-pgdump.html", "description": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "signature": "--enable-row-security", "source_url": "/docs/18/app-pgdump.html", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "signature": "--exclude-extension= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-and-children= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "signature": "--exclude-table-data= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only or --statistics-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--exclude-table-data-and-children= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "signature": "--extra-float-digits= ndigits", "source_url": "/docs/18/app-pgdump.html", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "signature": "--filter= filename", "source_url": "/docs/18/app-pgdump.html", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "signature": "--if-exists", "source_url": "/docs/18/app-pgdump.html", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "signature": "--include-foreign-data= foreignserver", "source_url": "/docs/18/app-pgdump.html", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "signature": "--inserts", "source_url": "/docs/18/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "signature": "--load-via-partition-root", "source_url": "/docs/18/app-pgdump.html", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "signature": "--lock-wait-timeout= timeout", "source_url": "/docs/18/app-pgdump.html", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "summary": "Do not dump COMMENT commands.", "signature": "--no-comments", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump COMMENT commands."}, {"names": ["--no-data"], "summary": "Do not dump data.", "signature": "--no-data", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump data."}, {"names": ["--no-policies"], "summary": "Do not dump row security policies.", "signature": "--no-policies", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump row security policies."}, {"names": ["--no-publications"], "summary": "Do not dump publications.", "signature": "--no-publications", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump publications."}, {"names": ["--no-schema"], "summary": "Do not dump schema (data definitions).", "signature": "--no-schema", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump schema (data definitions)."}, {"names": ["--no-security-labels"], "summary": "Do not dump security labels.", "signature": "--no-security-labels", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump security labels."}, {"names": ["--no-statistics"], "summary": "Do not dump statistics. This is the default.", "signature": "--no-statistics", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump statistics. This is the default."}, {"names": ["--no-subscriptions"], "summary": "Do not dump subscriptions.", "signature": "--no-subscriptions", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "signature": "--no-sync", "source_url": "/docs/18/app-pgdump.html", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "signature": "--no-table-access-method", "source_url": "/docs/18/app-pgdump.html", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "signature": "--no-tablespaces", "source_url": "/docs/18/app-pgdump.html", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "signature": "--no-toast-compression", "source_url": "/docs/18/app-pgdump.html", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "signature": "--no-unlogged-table-data", "source_url": "/docs/18/app-pgdump.html", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "signature": "--on-conflict-do-nothing", "source_url": "/docs/18/app-pgdump.html", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "signature": "--quote-all-identifiers", "source_url": "/docs/18/app-pgdump.html", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "signature": "--restrict-key= restrict_key", "source_url": "/docs/18/app-pgdump.html", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "signature": "--rows-per-insert= nrows", "source_url": "/docs/18/app-pgdump.html", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "signature": "--section= sectionname", "source_url": "/docs/18/app-pgdump.html", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items."}, {"names": ["--sequence-data"], "summary": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.", "signature": "--sequence-data", "source_url": "/docs/18/app-pgdump.html", "description": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."}, {"names": ["--serializable-deferrable"], "summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "signature": "--serializable-deferrable", "source_url": "/docs/18/app-pgdump.html", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.100 for more details).", "signature": "--snapshot= snapshotname", "source_url": "/docs/18/app-pgdump.html", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.100 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--statistics"], "summary": "Dump optimizer statistics.", "signature": "--statistics", "source_url": "/docs/18/app-pgdump.html", "description": "Dump optimizer statistics."}, {"names": ["--statistics-only"], "summary": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.", "signature": "--statistics-only", "source_url": "/docs/18/app-pgdump.html", "description": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."}, {"names": ["--strict-names"], "summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "signature": "--strict-names", "source_url": "/docs/18/app-pgdump.html", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "signature": "--sync-method= method", "source_url": "/docs/18/app-pgdump.html", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "signature": "--table-and-children= pattern", "source_url": "/docs/18/app-pgdump.html", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "signature": "--use-set-session-authorization", "source_url": "/docs/18/app-pgdump.html", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "summary": "Show help about pg_dump command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pgdump.html", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "signature": "-d dbname --dbname= dbname", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "signature": "-h host --host= host", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "signature": "-p port --port= port", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "summary": "User name to connect as.", "signature": "-U username --username= username", "source_url": "/docs/18/app-pgdump.html", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "signature": "-w --no-password", "source_url": "/docs/18/app-pgdump.html", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "summary": "Force pg_dump to prompt for a password before connecting to a database.", "signature": "-W --password", "source_url": "/docs/18/app-pgdump.html", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "signature": "--role= rolename", "source_url": "/docs/18/app-pgdump.html", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "related": [{"url": "/wiki/conn/?v=18", "label": "libpq \u8fde\u63a5\u53c2\u6570"}], "release": {"ref": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "label": "18.6", "major": "18", "channel": "stable", "manifest": {"pdf": {"A4": {"url": "/files/documentation/pdf/18/postgresql-18-A4.pdf", "bytes": 15865106, "pages": 3154, "sha256": "19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190", "built_at": "2026-09-26"}, "US": {"url": "/files/documentation/pdf/18/postgresql-18-US.pdf", "bytes": 15748059, "pages": 3328, "sha256": "facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319", "built_at": "2026-09-26"}}, "tree": "18", "index": "index.html", "major": "18", "pages": 1148, "release": "18.6", "source_url": "https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2", "svg_assets": 3, "source_mode": "en SGML built with pinned official archive", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "revision": "ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8", "evidence_kind": "English manual and source declarations", "source_sha256": "555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"}, "sources": [{"url": "https://pg.center/docs/18/app-pgdump.html", "file": "app-pgdump.html", "label": "18.6 English manual \u00b7 app-pgdump.html", "anchor": "", "sha256": "758860baaa3462061cc6343b8d04559ec3fbc9e77c00e426f5eb8b32c863509e", "language": "en", "original_url": "/docs/18/app-pgdump.html"}, {"url": "https://pg.center/docs/18/reference-client.html", "file": "reference-client.html", "label": "Client applications inventory", "anchor": "", "sha256": "68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0", "language": "en", "original_url": "/docs/18/reference-client.html"}], "sections": [], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "signature": "pg_dump [ connection-option ...] [ option ...] [ dbname ]", "description": ["pg_dump \u2014 \u5c06 PostgreSQL \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PGDUMP\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_dump</span></span></h2>\n<p lang=\"zh\">pg_dump \u2014 \u5c06 <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u5bfc\u51fa\u4e3a SQL \u811a\u672c\u6216\u5176\u4ed6\u683c\u5f0f</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.4.14.4.1\"><code class=\"command\">pg_dump</code> [<em class=\"replaceable\"><code>connection-option</code></em>...] [<em class=\"replaceable\"><code>option</code></em>...] [<em class=\"replaceable\"><code>dbname</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u662f\u4e00\u4e2a\u7528\u4e8e\u5bfc\u51fa <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u5de5\u5177\u3002\u5373\u4f7f\u6570\u636e\u5e93\u6b63\u5728\u88ab\u5e76\u53d1\u4f7f\u7528\uff0c\u5b83\u4e5f\u80fd\u751f\u6210\u4e00\u81f4\u7684\u5bfc\u51fa\u7ed3\u679c\u3002<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u6570\u636e\u5e93\uff08\u65e0\u8bba\u8bfb\u8fd8\u662f\u5199\uff09\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u9664\u4e86\u7b80\u5355\u573a\u666f\u4e4b\u5916\uff0c<span class=\"application\">pg_dump</span> \u901a\u5e38\u5e76\u4e0d\u662f\u5bf9\u751f\u4ea7\u6570\u636e\u5e93\u8fdb\u884c\u5e38\u89c4\u5907\u4efd\u7684\u6b63\u786e\u9009\u62e9\u3002\u8fdb\u4e00\u6b65\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/18/backup.html\" title=\"\u7b2c\u00a025\u00a0\u7ae0\u00a0\u5907\u4efd\u548c\u6062\u590d\">\u7b2c\u00a025\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u53ea\u8f6c\u50a8\u5355\u4e2a\u6570\u636e\u5e93\u3002\u8981\u5bfc\u51fa\u6574\u4e2a\u96c6\u7c07\uff0c\u6216\u8005\u5bfc\u51fa\u4e00\u4e2a\u96c6\u7c07\u4e2d\u6240\u6709\u6570\u636e\u5e93\u5171\u6709\u7684\u5168\u5c40\u5bf9\u8c61\uff08\u5982\u89d2\u8272\u548c\u8868\u7a7a\u95f4\uff09\uff0c\u8bf7\u4f7f\u7528<a class=\"xref\" href=\"/docs/18/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>\u3002</p>\n<p lang=\"zh\">\u8f6c\u50a8\u53ef\u4ee5\u8f93\u51fa\u4e3a\u811a\u672c\u683c\u5f0f\u6216\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u3002\u811a\u672c\u8f6c\u50a8\u662f\u7eaf\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u628a\u6570\u636e\u5e93\u91cd\u5efa\u5230\u4fdd\u5b58\u65f6\u72b6\u6001\u6240\u9700\u7684 SQL \u547d\u4ee4\u3002\u8981\u4ece\u8fd9\u6837\u7684\u811a\u672c\u6062\u590d\uff0c\u53ea\u9700\u5c06\u5176\u4ea4\u7ed9<a class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u3002\u811a\u672c\u6587\u4ef6\u751a\u81f3\u53ef\u4ee5\u5728\u5176\u4ed6\u673a\u5668\u548c\u5176\u4ed6\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7528\u4e8e\u91cd\u5efa\u6570\u636e\u5e93\uff1b\u7ecf\u8fc7\u4e00\u4e9b\u4fee\u6539\u540e\uff0c\u751a\u81f3\u4e5f\u53ef\u4ee5\u7528\u4e8e\u5176\u4ed6 SQL \u6570\u636e\u5e93\u4ea7\u54c1\u3002</p>\n<p lang=\"zh\">\u53e6\u4e00\u7c7b\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5fc5\u987b\u7ed3\u5408<a class=\"xref\" href=\"/docs/18/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>\u6765\u91cd\u5efa\u6570\u636e\u5e93\u3002\u5b83\u4eec\u5141\u8bb8 <span class=\"application\">pg_restore</span> \u6709\u9009\u62e9\u5730\u6062\u590d\u67d0\u4e9b\u5185\u5bb9\uff0c\u751a\u81f3\u5728\u6062\u590d\u4e4b\u524d\u91cd\u65b0\u6392\u5217\u6761\u76ee\u3002\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u88ab\u8bbe\u8ba1\u4e3a\u53ef\u8de8\u4f53\u7cfb\u7ed3\u6784\u79fb\u690d\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528\u5f52\u6863\u6587\u4ef6\u683c\u5f0f\u5e76\u914d\u5408 <span class=\"application\">pg_restore</span> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u5f52\u6863\u548c\u4f20\u8f93\u673a\u5236\u3002<span class=\"application\">pg_dump</span> \u53ef\u7528\u4e8e\u5bfc\u51fa\u6574\u4e2a\u6570\u636e\u5e93\uff0c\u800c <span class=\"application\">pg_restore</span> \u53ef\u7528\u4e8e\u68c0\u67e5\u5f52\u6863\u548c/\u6216\u9009\u62e9\u8981\u6062\u590d\u7684\u6570\u636e\u5e93\u90e8\u5206\u3002\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u6587\u4ef6\u683c\u5f0f\u662f<span class=\"quote\">\u201c<span class=\"quote\">custom</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fc</code>\uff09\u548c<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\uff08<code class=\"option\">-Fd</code>\uff09\u3002\u5b83\u4eec\u5141\u8bb8\u9009\u62e9\u548c\u91cd\u65b0\u6392\u5e8f\u6240\u6709\u5f52\u6863\u6761\u76ee\uff0c\u652f\u6301\u5e76\u884c\u6062\u590d\uff0c\u5e76\u4e14\u9ed8\u8ba4\u4f1a\u538b\u7f29\u3002\u53ea\u6709<span class=\"quote\">\u201c<span class=\"quote\">directory</span>\u201d</span>\u683c\u5f0f\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\uff0c\u5e94\u68c0\u67e5\u8f93\u51fa\u4e2d\u662f\u5426\u6709\u4efb\u4f55\u8b66\u544a\uff08\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\uff09\uff0c\u5c24\u5176\u8981\u7ed3\u5408\u4e0b\u9762\u5217\u51fa\u7684\u9650\u5236\u6765\u67e5\u770b\u3002</p>\n<div class=\"warning\">\n<h3 class=\"title\" lang=\"zh\">\u8b66\u544a</h3>\n<p lang=\"zh\">\u6062\u590d\u8f6c\u50a8\u4f1a\u5bfc\u81f4\u76ee\u6807\u7aef\u6267\u884c\u7531\u6e90\u8d85\u7ea7\u7528\u6237\u9009\u62e9\u7684\u4efb\u610f\u4ee3\u7801\u3002\u90e8\u5206\u8f6c\u50a8\u548c\u90e8\u5206\u6062\u590d\u5e76\u4e0d\u4f1a\u9650\u5236\u8fd9\u4e00\u70b9\u3002\u5982\u679c\u6e90\u8d85\u7ea7\u7528\u6237\u4e0d\u53ef\u4fe1\uff0c\u5219\u5fc5\u987b\u5728\u6062\u590d\u524d\u68c0\u67e5\u8f6c\u50a8\u5f97\u5230\u7684 SQL \u8bed\u53e5\u3002\u975e\u7eaf\u6587\u672c\u8f6c\u50a8\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">pg_restore</span> \u7684 <code class=\"option\">--file</code> \u9009\u9879\u8fdb\u884c\u68c0\u67e5\u3002\u6ce8\u610f\uff0c\u8fd0\u884c\u8f6c\u50a8\u548c\u6062\u590d\u7684\u5ba2\u6237\u7aef\u65e0\u9700\u4fe1\u4efb\u6e90\u6216\u76ee\u6807\u8d85\u7ea7\u7528\u6237\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u8f93\u51fa\u7684\u5185\u5bb9\u548c\u683c\u5f0f\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><em class=\"replaceable\"><code>dbname</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u5982\u679c\u672a\u6307\u5b9a\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATABASE</code>\u3002\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u53d8\u91cf\uff0c\u5219\u4f7f\u7528\u8fde\u63a5\u6307\u5b9a\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-a</code><br/></span><span class=\"term\"><code class=\"option\">--data-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u6570\u636e\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u7edf\u8ba1\u4fe1\u606f\u3002\u4f1a\u8f6c\u50a8\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u548c\u5e8f\u5217\u503c\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-b</code><br/></span><span class=\"term\"><code class=\"option\">--large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5927\u5bf9\u8c61\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--schema</code>\u3001<code class=\"option\">--table</code>\u3001<code class=\"option\">--schema-only</code>\u3001<code class=\"option\">--statistics-only</code> \u6216 <code class=\"option\">--no-data</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002\u56e0\u6b64\uff0c<code class=\"option\">-b</code> \u5f00\u5173\u53ea\u5728\u5df2\u7ecf\u8bf7\u6c42\u4e86\u7279\u5b9a\u6a21\u5f0f\u6216\u8868\u7684\u8f6c\u50a8\u4e2d\uff0c\u9700\u8981\u628a\u5927\u5bf9\u8c61\u518d\u52a0\u56de\u6765\u65f6\u624d\u6709\u7528\u3002\u6ce8\u610f\uff0c\u5927\u5bf9\u8c61\u88ab\u89c6\u4e3a\u6570\u636e\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 <code class=\"option\">--data-only</code> \u65f6\u4f1a\u5305\u542b\uff0c\u5728\u4f7f\u7528 <code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code> \u65f6\u5219\u4e0d\u4f1a\u5305\u542b\u3002</p>\n</p>\n</dd>\n<dt lang=\"zh\"><span class=\"term\"><code class=\"option\">-B</code><br/></span><span class=\"term\"><code class=\"option\">--no-large-objects</code><br/></span><span class=\"term\"><code class=\"option\">--no-blobs</code>\uff08\u5df2\u5f03\u7528\uff09</span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u4e2d\u6392\u9664\u5927\u5bf9\u8c61\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa<code class=\"option\">-b</code>\u548c<code class=\"option\">-B</code>\u65f6\uff0c\u884c\u4e3a\u662f\u5728\u8f6c\u50a8\u6570\u636e\u65f6\u8f93\u51fa\u5927\u5bf9\u8c61\uff0c\u8bf7\u53c2\u9605<code class=\"option\">-b</code>\u6587\u6863\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--clean</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f93\u51fa\u521b\u5efa\u8fd9\u4e9b\u5bf9\u8c61\u7684\u547d\u4ee4\u4e4b\u524d\uff0c\u5148\u8f93\u51fa\u7528\u4e8e <code class=\"command\">DROP</code> \u6240\u6709\u88ab\u8f6c\u50a8\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u547d\u4ee4\u3002\u5f53\u6062\u590d\u8981\u8986\u76d6\u73b0\u6709\u6570\u636e\u5e93\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u5982\u679c\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u5bf9\u8c61\u4e0d\u5b58\u5728\uff0c\u5219\u5728\u6062\u590d\u671f\u95f4\u4f1a\u62a5\u544a\u53ef\u5ffd\u7565\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u9664\u975e\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--if-exists</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C</code><br/></span><span class=\"term\"><code class=\"option\">--create</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8ba9\u8f93\u51fa\u4ee5\u521b\u5efa\u6570\u636e\u5e93\u672c\u8eab\u5e76\u91cd\u65b0\u8fde\u63a5\u5230\u65b0\u5efa\u6570\u636e\u5e93\u7684\u547d\u4ee4\u5f00\u59cb\u3002\uff08\u4f7f\u7528\u8fd9\u79cd\u5f62\u5f0f\u7684\u811a\u672c\u65f6\uff0c\u5728\u76ee\u6807\u5b89\u88c5\u4e2d\u5148\u8fde\u63a5\u5230\u54ea\u4e2a\u6570\u636e\u5e93\u518d\u8fd0\u884c\u811a\u672c\u90fd\u65e0\u5173\u7d27\u8981\u3002\uff09\u5982\u679c\u8fd8\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5219\u811a\u672c\u4f1a\u5728\u91cd\u65b0\u8fde\u63a5\u5230\u76ee\u6807\u6570\u636e\u5e93\u4e4b\u524d\u5148\u5220\u9664\u5e76\u91cd\u65b0\u521b\u5efa\u5b83\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"option\">--create</code> \u65f6\uff0c\u8f93\u51fa\u8fd8\u4f1a\u5305\u542b\u8be5\u6570\u636e\u5e93\u7684\u6ce8\u91ca\uff08\u5982\u679c\u6709\uff09\uff0c\u4ee5\u53ca\u8be5\u6570\u636e\u5e93\u7279\u6709\u7684\u4efb\u4f55\u914d\u7f6e\u53d8\u91cf\u8bbe\u7f6e\uff0c\u4e5f\u5c31\u662f\u63d0\u53ca\u8be5\u6570\u636e\u5e93\u7684\u4efb\u4f55 <code class=\"command\">ALTER DATABASE ... SET ...</code> \u548c <code class=\"command\">ALTER ROLE ... IN DATABASE ... SET ...</code> \u547d\u4ee4\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-acl</code>\uff0c\u5426\u5219\u6570\u636e\u5e93\u672c\u8eab\u7684\u8bbf\u95ee\u6743\u9650\u4e5f\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u4e0e<em class=\"replaceable\"><code>pattern</code></em>\u5339\u914d\u7684\u6269\u5c55\u3002\u5f53\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a<code class=\"option\">-e</code>\u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6269\u5c55\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\u3002</p>\n<p lang=\"zh\">\u7531 <code class=\"function\">pg_extension_config_dump</code> \u6ce8\u518c\u7684\u4efb\u4f55\u914d\u7f6e\u5173\u7cfb\uff0c\u5982\u679c\u5176\u6240\u5c5e\u6269\u5c55\u7531 <code class=\"option\">--extension</code> \u6307\u5b9a\uff0c\u4e5f\u4f1a\u5305\u542b\u5728\u8f6c\u50a8\u4e2d\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a<code class=\"option\">-e</code>\u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span>\u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6269\u5c55\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6269\u5c55\u7684\u8f6c\u50a8\u7ed3\u679c\u53ef\u4ee5\u6210\u529f\u5730\u5355\u72ec\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E <em class=\"replaceable\"><code>encoding</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--encoding=<em class=\"replaceable\"><code>encoding</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6307\u5b9a\u7684\u5b57\u7b26\u96c6\u7f16\u7801\u4e2d\u521b\u5efa\u8f6c\u50a8\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8f6c\u50a8\u5c06\u4ee5\u6570\u636e\u5e93\u7f16\u7801\u521b\u5efa\u3002\uff08\u83b7\u5f97\u76f8\u540c\u7ed3\u679c\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5c06<code class=\"envar\">PGCLIENTENCODING</code>\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u4e3a\u6240\u9700\u7684\u8f6c\u50a8\u7f16\u7801\u3002\uff09\u652f\u6301\u7684\u7f16\u7801\u5728<a class=\"xref\" href=\"/docs/18/multibyte.html#MULTIBYTE-CHARSET-SUPPORTED\" title=\"23.3.1.\u00a0\u652f\u6301\u7684\u5b57\u7b26\u96c6\">\u7b2c\u00a023.3.1\u00a0\u8282</a>\u4e2d\u63cf\u8ff0\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-f <em class=\"replaceable\"><code>file</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--file=<em class=\"replaceable\"><code>file</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u8f93\u51fa\u53d1\u9001\u5230\u6307\u5b9a\u6587\u4ef6\u3002\u5bf9\u4e8e\u57fa\u4e8e\u6587\u4ef6\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u53c2\u6570\uff0c\u8fd9\u65f6\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\uff0c\u5fc5\u987b\u7ed9\u51fa\u6b64\u53c2\u6570\uff0c\u56e0\u4e3a\u5b83\u6307\u5b9a\u7684\u662f\u76ee\u6807\u76ee\u5f55\u800c\u4e0d\u662f\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8be5\u76ee\u5f55\u7531 <code class=\"command\">pg_dump</code> \u521b\u5efa\uff0c\u5e76\u4e14\u5728\u6b64\u4e4b\u524d\u5fc5\u987b\u4e0d\u5b58\u5728\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F <em class=\"replaceable\"><code>format</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--format=<em class=\"replaceable\"><code>format</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u9009\u62e9\u8f93\u51fa\u7684\u683c\u5f0f\u3002<em class=\"replaceable\"><code>format</code></em> \u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e4b\u4e00\uff1a</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"literal\">p</code><br/></span><span class=\"term\"><code class=\"literal\">plain</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7eaf\u6587\u672c <acronym class=\"acronym\">SQL</acronym> \u811a\u672c\u6587\u4ef6\uff08\u9ed8\u8ba4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">c</code><br/></span><span class=\"term\"><code class=\"literal\">custom</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 custom \u683c\u5f0f\u5f52\u6863\u3002\u4e0e\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e00\u8d77\uff0c\u8fd9\u662f\u6700\u7075\u6d3b\u7684\u8f93\u51fa\u683c\u5f0f\uff0c\u56e0\u4e3a\u5b83\u5141\u8bb8\u5728\u6062\u590d\u65f6\u624b\u5de5\u9009\u62e9\u5e76\u91cd\u65b0\u6392\u5e8f\u5f52\u6863\u6761\u76ee\u3002\u8fd9\u79cd\u683c\u5f0f\u9ed8\u8ba4\u4e5f\u4f1a\u538b\u7f29\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">d</code><br/></span><span class=\"term\"><code class=\"literal\">directory</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u9002\u5408\u4f9b <span class=\"application\">pg_restore</span> \u4f7f\u7528\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u8fd9\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u6bcf\u4e2a\u88ab\u8f6c\u50a8\u7684\u8868\u548c\u5927\u5bf9\u8c61\u5404\u6709\u4e00\u4e2a\u6587\u4ef6\uff0c\u5916\u52a0\u4e00\u4e2a\u6240\u8c13\u7684\u76ee\u5f55\u8868\uff08Table of Contents\uff09\u6587\u4ef6\uff0c\u4ee5\u673a\u5668\u53ef\u8bfb\u683c\u5f0f\u63cf\u8ff0\u88ab\u8f6c\u50a8\u5bf9\u8c61\uff0c<span class=\"application\">pg_restore</span> \u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002directory \u683c\u5f0f\u5f52\u6863\u53ef\u4ee5\u7528\u6807\u51c6 Unix \u5de5\u5177\u6765\u64cd\u4f5c\uff1b\u4f8b\u5982\uff0c\u672a\u538b\u7f29\u5f52\u6863\u4e2d\u7684\u6587\u4ef6\u53ef\u4ee5\u4f7f\u7528 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u5de5\u5177\u8fdb\u884c\u538b\u7f29\u3002\u8be5\u683c\u5f0f\u9ed8\u8ba4\u4f7f\u7528 <code class=\"literal\">gzip</code> \u538b\u7f29\uff0c\u5e76\u4e14\u652f\u6301\u5e76\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"literal\">t</code><br/></span><span class=\"term\"><code class=\"literal\">tar</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa <code class=\"command\">tar</code> \u683c\u5f0f\u5f52\u6863\uff0c\u9002\u5408\u4f9b<span class=\"application\">pg_restore</span>\u4f7f\u7528\u3002tar \u683c\u5f0f\u4e0e directory \u683c\u5f0f\u517c\u5bb9\uff1a\u89e3\u5f00\u4e00\u4e2a tar \u683c\u5f0f\u5f52\u6863\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a\u6709\u6548\u7684 directory \u683c\u5f0f\u5f52\u6863\u3002\u4e0d\u8fc7\uff0ctar \u683c\u5f0f\u4e0d\u652f\u6301\u538b\u7f29\u3002\u53e6\u5916\uff0c\u4f7f\u7528 tar \u683c\u5f0f\u65f6\uff0c\u5728\u6062\u590d\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u6539\u53d8\u8868\u6570\u636e\u9879\u7684\u76f8\u5bf9\u987a\u5e8f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j <em class=\"replaceable\"><code>njobs</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--jobs=<em class=\"replaceable\"><code>njobs</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ee5\u5e76\u884c\u65b9\u5f0f\u8fd0\u884c\u8f6c\u50a8\uff0c\u540c\u65f6\u8f6c\u50a8 <em class=\"replaceable\"><code>njobs</code></em> \u4e2a\u8868\u3002\u6b64\u9009\u9879\u53ef\u80fd\u51cf\u5c11\u6267\u884c\u8f6c\u50a8\u6240\u9700\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u4f1a\u589e\u52a0\u6570\u636e\u5e93\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u3002\u53ea\u80fd\u5728\u76ee\u5f55\u8f93\u51fa\u683c\u5f0f\u4e0b\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u56e0\u4e3a\u53ea\u6709\u8fd9\u79cd\u8f93\u51fa\u683c\u5f0f\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u5199\u5165\u6570\u636e\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5c06\u6253\u5f00 <em class=\"replaceable\"><code>njobs</code></em> + 1 \u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u8bbe\u7f6e\u8db3\u591f\u9ad8\uff0c\u80fd\u591f\u5bb9\u7eb3\u6240\u6709\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u8bf7\u6c42\u6570\u636e\u5e93\u5bf9\u8c61\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u53ef\u80fd\u5bfc\u81f4\u8f6c\u50a8\u5931\u8d25\u3002\u539f\u56e0\u662f <span class=\"application\">pg_dump</span> \u7684\u9886\u5bfc\u8005\u8fdb\u7a0b\u4f1a\u5bf9\u7a0d\u540e\u7531\u5de5\u4f5c\u8fdb\u7a0b\u8f6c\u50a8\u7684\u5bf9\u8c61\u8bf7\u6c42\u5171\u4eab\u9501\uff08<a class=\"link\" href=\"/docs/18/explicit-locking.html#LOCKING-TABLES\" title=\"13.3.1.\u00a0\u8868\u7ea7\u9501\">ACCESS SHARE</a>\uff09\uff0c\u4ee5\u786e\u4fdd\u5728\u8f6c\u50a8\u8fd0\u884c\u671f\u95f4\u6ca1\u6709\u4eba\u5220\u9664\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5982\u679c\u53e6\u4e00\u4e2a\u5ba2\u6237\u7aef\u968f\u540e\u8bf7\u6c42\u67d0\u4e2a\u8868\u4e0a\u7684\u6392\u4ed6\u9501\uff0c\u8be5\u9501\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u800c\u662f\u4f1a\u6392\u961f\u7b49\u5f85\u9886\u5bfc\u8005\u8fdb\u7a0b\u91ca\u653e\u5171\u4eab\u9501\u3002\u4e8e\u662f\uff0c\u5bf9\u8be5\u8868\u7684\u4efb\u4f55\u5176\u4ed6\u8bbf\u95ee\u4e5f\u90fd\u4e0d\u4f1a\u88ab\u6388\u4e88\uff0c\u5e76\u4f1a\u6392\u5728\u8be5\u6392\u4ed6\u9501\u8bf7\u6c42\u4e4b\u540e\uff0c\u5176\u4e2d\u5305\u62ec\u8bd5\u56fe\u8f6c\u50a8\u8be5\u8868\u7684\u5de5\u4f5c\u8fdb\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u9884\u9632\u63aa\u65bd\uff0c\u8fd9\u5c31\u4f1a\u5f62\u6210\u4e00\u4e2a\u7ecf\u5178\u7684\u6b7b\u9501\u573a\u666f\u3002\u4e3a\u68c0\u6d4b\u8fd9\u79cd\u51b2\u7a81\uff0c<span class=\"application\">pg_dump</span> \u5de5\u4f5c\u8fdb\u7a0b\u4f1a\u4f7f\u7528 <code class=\"literal\">NOWAIT</code> \u9009\u9879\u518d\u8bf7\u6c42\u4e00\u4e2a\u5171\u4eab\u9501\u3002\u5982\u679c\u5de5\u4f5c\u8fdb\u7a0b\u62ff\u4e0d\u5230\u8fd9\u4e2a\u5171\u4eab\u9501\uff0c\u5c31\u8bf4\u660e\u8fd9\u671f\u95f4\u5df2\u7ecf\u6709\u4eba\u8bf7\u6c42\u4e86\u6392\u4ed6\u9501\uff0c\u800c\u6b64\u65f6\u5df2\u7ecf\u65e0\u6cd5\u7ee7\u7eed\u8f6c\u50a8\uff0c\u56e0\u6b64 <span class=\"application\">pg_dump</span> \u53ea\u80fd\u4e2d\u6b62\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u8981\u6267\u884c\u5e76\u884c\u8f6c\u50a8\uff0c\u6570\u636e\u5e93\u670d\u52a1\u5668\u9700\u8981\u652f\u6301\u540c\u6b65\u5feb\u7167\u3002\u8fd9\u4e00\u7279\u6027\u662f\u5728 <span class=\"productname\">PostgreSQL</span> 9.2 \u4e2d\u4e3a\u4e3b\u5e93\u5f15\u5165\u7684\uff0c\u5728 10 \u4e2d\u4e3a\u5907\u5e93\u5f15\u5165\u3002\u6709\u4e86\u8fd9\u4e2a\u7279\u6027\uff0c\u6570\u636e\u5e93\u5ba2\u6237\u7aef\u5373\u4f7f\u4f7f\u7528\u4e0d\u540c\u8fde\u63a5\uff0c\u4e5f\u80fd\u4fdd\u8bc1\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\u96c6\u3002<code class=\"command\">pg_dump -j</code> \u4f1a\u4f7f\u7528\u591a\u4e2a\u6570\u636e\u5e93\u8fde\u63a5\uff1a\u5b83\u4f1a\u5148\u7531\u9886\u5bfc\u8005\u8fdb\u7a0b\u8fde\u63a5\u6570\u636e\u5e93\u4e00\u6b21\uff0c\u7136\u540e\u6bcf\u4e2a\u5de5\u4f5c\u4efb\u52a1\u518d\u5404\u8fde\u4e00\u6b21\u3002\u82e5\u6ca1\u6709\u540c\u6b65\u5feb\u7167\u7279\u6027\uff0c\u5c31\u65e0\u6cd5\u4fdd\u8bc1\u5404\u4e2a\u5de5\u4f5c\u4efb\u52a1\u5728\u5404\u81ea\u8fde\u63a5\u4e2d\u770b\u5230\u76f8\u540c\u7684\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u5907\u4efd\u4e0d\u4e00\u81f4\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\uff1b\u8fd9\u65e2\u4f1a\u9009\u62e9\u6a21\u5f0f\u672c\u8eab\uff0c\u4e5f\u4f1a\u9009\u62e9\u5176\u4e2d\u5305\u542b\u7684\u6240\u6709\u5bf9\u8c61\u3002\u672a\u6307\u5b9a\u6b64\u9009\u9879\u65f6\uff0c\u5c06\u8f6c\u50a8\u76ee\u6807\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u975e\u7cfb\u7edf\u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u6a21\u5f0f\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/18/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u6a21\u5f0f\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u6a21\u5f0f\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">-n</code> \u65f6\uff0c\u4e0d\u4f1a\u8f6c\u50a8\u5927\u5bf9\u8c61\u7b49\u975e\u6a21\u5f0f\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528 <code class=\"option\">--large-objects</code> \u5f00\u5173\u628a\u5927\u5bf9\u8c61\u52a0\u56de\u8f6c\u50a8\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-schema=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6a21\u5f0f\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-n</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-N</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6a21\u5f0f\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-n</code> \u548c <code class=\"option\">-N</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-n</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-N</code> \u5f00\u5173\u7684\u6a21\u5f0f\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-N</code> \u800c\u6ca1\u6709 <code class=\"option\">-n</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-N</code> \u7684\u6a21\u5f0f\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code><br/></span><span class=\"term\"><code class=\"option\">--no-owner</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u628a\u5bf9\u8c61\u6240\u6709\u6743\u8bbe\u7f6e\u6210\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u4e00\u81f4\u7684\u547d\u4ee4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u53d1\u51fa <code class=\"command\">ALTER OWNER</code> \u6216 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u8bed\u53e5\u6765\u8bbe\u7f6e\u65b0\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u6240\u6709\u6743\u3002\u9664\u975e\u811a\u672c\u7531\u8d85\u7ea7\u7528\u6237\uff08\u6216\u62e5\u6709\u811a\u672c\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u540c\u4e00\u7528\u6237\uff09\u542f\u52a8\uff0c\u5426\u5219\u8fd9\u4e9b\u8bed\u53e5\u4f1a\u5728\u8fd0\u884c\u811a\u672c\u65f6\u62a5\u9519\u3002\u82e5\u8981\u521b\u5efa\u4e00\u4e2a\u53ef\u7531\u4efb\u610f\u7528\u6237\u6062\u590d\u3001\u5e76\u8ba9\u8be5\u7528\u6237\u62e5\u6709\u6240\u6709\u5bf9\u8c61\u7684\u811a\u672c\uff0c\u8bf7\u6307\u5b9a <code class=\"option\">-O</code>\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-R</code><br/></span><span class=\"term\"><code class=\"option\">--no-reconnect</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e2a\u9009\u9879\u5df2\u7ecf\u8fc7\u65f6\uff0c\u4f46\u4ecd\u7136\u88ab\u63a5\u53d7\u4ee5\u4fdd\u6301\u5411\u540e\u517c\u5bb9\u6027\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--schema-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u5bf9\u8c61\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff0c\u4e0d\u8f6c\u50a8\u6570\u636e\u6216\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e0d\u80fd\u4e0e <code class=\"option\">--data-only</code> \u6216 <code class=\"option\">--statistics-only</code> \u4e00\u8d77\u4f7f\u7528\u3002\u5b83\u7c7b\u4f3c\u4e8e\u6307\u5b9a <code class=\"option\">--section=pre-data --section=post-data</code>\uff0c\u4f46\u51fa\u4e8e\u5386\u53f2\u539f\u56e0\uff0c\u4e24\u8005\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002</p>\n<p lang=\"zh\">\uff08\u4e0d\u8981\u628a\u5b83\u4e0e <code class=\"option\">--schema</code> \u9009\u9879\u6df7\u6dc6\uff0c\u540e\u8005\u4e2d\u7684<span class=\"quote\">\u201c<span class=\"quote\">schema</span>\u201d</span>\u4e00\u8bcd\u542b\u4e49\u4e0d\u540c\u3002\uff09</p>\n<p lang=\"zh\">\u8981\u53ea\u6392\u9664\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u8868\u7684\u8868\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--exclude-table-data</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--superuser=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5728\u7981\u7528\u89e6\u53d1\u5668\u65f6\u8981\u4f7f\u7528\u7684\u8d85\u7ea7\u7528\u6237\u540d\u3002\u8fd9\u53ea\u5728\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u65f6\u76f8\u5173\u3002\uff08\u901a\u5e38\u6700\u597d\u7701\u7565\u5b83\uff0c\u800c\u662f\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u53ea\u8f6c\u50a8\u540d\u79f0\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002<em class=\"replaceable\"><code>pattern</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u8868\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/18/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002</p>\n<p lang=\"zh\">\u9664\u4e86\u8868\u4e4b\u5916\uff0c\u6b64\u9009\u9879\u8fd8\u53ef\u7528\u4e8e\u8f6c\u50a8\u5339\u914d\u7684\u89c6\u56fe\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\u3002\u5b83\u4e0d\u4f1a\u8f6c\u50a8\u89c6\u56fe\u6216\u7269\u5316\u89c6\u56fe\u7684\u5185\u5bb9\uff0c\u800c\u5916\u90e8\u8868\u7684\u5185\u5bb9\u53ea\u6709\u5728\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u6307\u5b9a\u4e86\u76f8\u5e94\u5916\u90e8\u670d\u52a1\u5668\u65f6\u624d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<p lang=\"zh\">\u4f7f\u7528 -t \u65f6\uff0c-n \u548c -N \u9009\u9879\u4e0d\u751f\u6548\uff0c\u56e0\u4e3a -t \u9009\u4e2d\u7684\u8868\u65e0\u8bba\u5982\u4f55\u90fd\u4f1a\u88ab\u8f6c\u50a8\uff0c\u800c\u975e\u8868\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u8f6c\u50a8\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">-t</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u5c1d\u8bd5\u8f6c\u50a8\u6240\u9009\u8868\u53ef\u80fd\u4f9d\u8d56\u7684\u4efb\u4f55\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u7279\u5b9a\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u80fd\u591f\u5355\u72ec\u6210\u529f\u6062\u590d\u5230\u4e00\u4e2a\u5e72\u51c0\u7684\u6570\u636e\u5e93\u4e2d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T <em class=\"replaceable\"><code>pattern</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--exclude-table=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">-T</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-t</code> \u548c <code class=\"option\">-T</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-t</code> \u5f00\u5173\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">-T</code> \u5f00\u5173\u7684\u8868\u3002\u5982\u679c\u51fa\u73b0 <code class=\"option\">-T</code> \u800c\u6ca1\u6709 <code class=\"option\">-t</code>\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">-T</code> \u7684\u8868\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code><br/></span><span class=\"term\"><code class=\"option\">--verbose</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8be6\u7ec6\u6a21\u5f0f\u3002\u8fd9\u4f1a\u4f7f <span class=\"application\">pg_dump</span> \u5c06\u8be6\u7ec6\u7684\u5bf9\u8c61\u6ce8\u91ca\u3001\u5f00\u59cb/\u505c\u6b62\u65f6\u95f4\u5199\u5165\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u628a\u8fdb\u5ea6\u6d88\u606f\u5199\u5230\u6807\u51c6\u9519\u8bef\u3002\u91cd\u590d\u8be5\u9009\u9879\u4f1a\u8ba9\u66f4\u591a\u8c03\u8bd5\u7ea7\u522b\u6d88\u606f\u51fa\u73b0\u5728\u6807\u51c6\u9519\u8bef\u4e2d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370 <span class=\"application\">pg_dump</span> \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-x</code><br/></span><span class=\"term\"><code class=\"option\">--no-privileges</code><br/></span><span class=\"term\"><code class=\"option\">--no-acl</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f6c\u50a8\u8bbf\u95ee\u6743\u9650\uff08grant/revoke \u547d\u4ee4\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">-Z <em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]<br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>level</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--compress=<em class=\"replaceable\"><code>method</code></em></code>[:<em class=\"replaceable\"><code>detail</code></em>]</span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u538b\u7f29\u65b9\u6cd5\u548c/\u6216\u538b\u7f29\u7ea7\u522b\u3002\u538b\u7f29\u65b9\u6cd5\u53ef\u4ee5\u8bbe\u7f6e\u4e3a <code class=\"literal\">gzip</code>\u3001<code class=\"literal\">lz4</code>\u3001<code class=\"literal\">zstd</code> \u6216 <code class=\"literal\">none</code>\uff08\u8868\u793a\u4e0d\u538b\u7f29\uff09\u3002\u4e5f\u53ef\u4ee5\u9009\u62e9\u6307\u5b9a\u538b\u7f29\u7ec6\u8282\u5b57\u7b26\u4e32\u3002\u5982\u679c\u7ec6\u8282\u5b57\u7b26\u4e32\u662f\u4e00\u4e2a\u6574\u6570\uff0c\u5219\u8868\u793a\u538b\u7f29\u7ea7\u522b\uff1b\u5426\u5219\uff0c\u5b83\u5e94\u662f\u4e00\u4e2a\u7528\u9017\u53f7\u5206\u9694\u7684\u9879\u5217\u8868\uff0c\u6bcf\u9879\u5f62\u5982 <code class=\"literal\">keyword</code> \u6216 <code class=\"literal\">keyword=value</code>\u3002\u76ee\u524d\u652f\u6301\u7684\u5173\u952e\u5b57\u662f <code class=\"literal\">level</code> \u548c <code class=\"literal\">long</code>\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u672a\u6307\u5b9a\u538b\u7f29\u7ea7\u522b\uff0c\u5c06\u4f7f\u7528\u9ed8\u8ba4\u7ea7\u522b\u3002\u5982\u679c\u53ea\u6307\u5b9a\u7ea7\u522b\u800c\u672a\u6307\u5b9a\u7b97\u6cd5\uff0c\u5219\u7ea7\u522b\u5927\u4e8e 0 \u65f6\u4f7f\u7528 gzip \u538b\u7f29\uff0c\u7ea7\u522b\u4e3a 0 \u65f6\u4e0d\u538b\u7f29\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e custom \u548c directory \u5f52\u6863\u683c\u5f0f\uff0c\u6b64\u9009\u9879\u6307\u5b9a\u5bf9\u5404\u4e2a\u8868\u6570\u636e\u6bb5\u7684\u538b\u7f29\uff0c\u9ed8\u8ba4\u662f\u4f7f\u7528\u4e2d\u7b49\u7ea7\u522b\u7684 <code class=\"literal\">gzip</code> \u8fdb\u884c\u538b\u7f29\u3002\u5bf9\u4e8e\u7eaf\u6587\u672c\u8f93\u51fa\uff0c\u8bbe\u7f6e\u975e\u96f6\u538b\u7f29\u7ea7\u522b\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8f93\u51fa\u6587\u4ef6\u88ab\u538b\u7f29\uff0c\u5c31\u50cf\u5b83\u7ecf\u8fc7\u4e86 <span class=\"application\">gzip</span>\u3001<span class=\"application\">lz4</span> \u6216 <span class=\"application\">zstd</span> \u4e00\u6837\uff1b\u4f46\u9ed8\u8ba4\u662f\u4e0d\u538b\u7f29\u3002\u4f7f\u7528 zstd \u538b\u7f29\u65f6\uff0c<code class=\"literal\">long</code> \u6a21\u5f0f\u53ef\u80fd\u63d0\u9ad8\u538b\u7f29\u6bd4\uff0c\u4f46\u4ee3\u4ef7\u662f\u5185\u5b58\u4f7f\u7528\u589e\u52a0\u3002</p>\n<p lang=\"zh\">tar \u5f52\u6863\u683c\u5f0f\u76ee\u524d\u5b8c\u5168\u4e0d\u652f\u6301\u538b\u7f29\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--binary-upgrade</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u4f9b\u5c31\u5730\u5347\u7ea7\u5b9e\u7528\u7a0b\u5e8f\u4f7f\u7528\u3002\u4e0d\u5efa\u8bae\u4e5f\u4e0d\u652f\u6301\u5c06\u5176\u7528\u4e8e\u5176\u4ed6\u76ee\u7684\u3002\u8be5\u9009\u9879\u7684\u884c\u4e3a\u53ef\u80fd\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u66f4\u6539\u800c\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--column-inserts</code><br/></span><span class=\"term\"><code class=\"option\">--attribute-inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a\u5e26\u6709\u663e\u5f0f\u5217\u540d\u7684<code class=\"command\">INSERT</code>\u547d\u4ee4\uff08<code class=\"literal\">INSERT INTO <em class=\"replaceable\"><code>table</code></em> (<em class=\"replaceable\"><code>column</code></em>, ...) VALUES ...</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u53d8\u5f97\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u6587\u4ef6\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-dollar-quoting</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7981\u7528\u5bf9\u51fd\u6570\u4f53\u7684\u7f8e\u5143\u5f15\u7528\uff0c\u5e76\u5f3a\u5236\u7528 SQL \u6807\u51c6\u5b57\u7b26\u4e32\u8bed\u6cd5\u5bf9\u5b83\u4eec\u52a0\u5f15\u53f7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--disable-triggers</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u521b\u5efa\u5305\u542b\u6570\u636e\u4f46\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u65f6\u624d\u76f8\u5173\u3002\u5b83\u6307\u793a <span class=\"application\">pg_dump</span> \u5728\u8f93\u51fa\u4e2d\u5305\u542b\u4e00\u4e9b\u547d\u4ee4\uff0c\u4ee5\u4fbf\u5728\u6062\u590d\u6570\u636e\u65f6\u4e34\u65f6\u7981\u7528\u76ee\u6807\u8868\u4e0a\u7684\u89e6\u53d1\u5668\u3002\u5982\u679c\u8fd9\u4e9b\u8868\u4e0a\u5b58\u5728\u4e0d\u5e0c\u671b\u5728\u6570\u636e\u6062\u590d\u671f\u95f4\u89e6\u53d1\u7684\u5f15\u7528\u5b8c\u6574\u6027\u68c0\u67e5\u6216\u5176\u4ed6\u89e6\u53d1\u5668\uff0c\u8bf7\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u76ee\u524d\uff0c\u4e3a <code class=\"option\">--disable-triggers</code> \u8f93\u51fa\u7684\u8fd9\u4e9b\u547d\u4ee4\u5fc5\u987b\u7531\u8d85\u7ea7\u7528\u6237\u6267\u884c\u3002\u56e0\u6b64\uff0c\u8fd8\u5e94\u901a\u8fc7 <code class=\"option\">-S</code> \u6307\u5b9a\u4e00\u4e2a\u8d85\u7ea7\u7528\u6237\u540d\uff0c\u6216\u8005\u66f4\u597d\u7684\u505a\u6cd5\u662f\u8c28\u614e\u5730\u4ee5\u8d85\u7ea7\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u751f\u6210\u7684\u811a\u672c\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--enable-row-security</code></span></dt>\n<dd>\n<p lang=\"zh\">\u6b64\u9009\u9879\u53ea\u5728\u8f6c\u50a8\u542f\u7528\u4e86\u884c\u5b89\u5168\u7684\u8868\u5185\u5bb9\u65f6\u624d\u76f8\u5173\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a off\uff0c\u4ee5\u786e\u4fdd\u628a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\u90fd\u8f6c\u50a8\u51fa\u6765\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u8db3\u591f\u7684\u6743\u9650\u7ed5\u8fc7\u884c\u5b89\u5168\uff0c\u5219\u4f1a\u629b\u51fa\u9519\u8bef\u3002\u8be5\u53c2\u6570\u4f1a\u6307\u793a <span class=\"application\">pg_dump</span> \u6539\u4e3a\u5c06<a class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-ROW-SECURITY\">row_security</a>\u8bbe\u7f6e\u4e3a on\uff0c\u4ece\u800c\u5141\u8bb8\u7528\u6237\u53ea\u8f6c\u50a8\u5176\u6709\u6743\u8bbf\u95ee\u7684\u90a3\u90e8\u5206\u8868\u5185\u5bb9\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u5f53\u524d\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u901a\u5e38\u8fd8\u4f1a\u5e0c\u671b\u8ba9\u8f6c\u50a8\u91c7\u7528 <code class=\"command\">INSERT</code> \u683c\u5f0f\uff0c\u56e0\u4e3a\u6062\u590d\u671f\u95f4\u7684 <code class=\"command\">COPY FROM</code> \u4e0d\u652f\u6301\u884c\u5b89\u5168\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-extension=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u6269\u5c55\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-e</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-extension</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u6269\u5c55\u3002</p>\n<p lang=\"zh\">\u5f53\u540c\u65f6\u7ed9\u51fa <code class=\"option\">-e</code> \u548c <code class=\"option\">--exclude-extension</code> \u65f6\uff0c\u5176\u884c\u4e3a\u662f\u53ea\u8f6c\u50a8\u81f3\u5c11\u5339\u914d\u4e00\u4e2a <code class=\"option\">-e</code> \u5f00\u5173\u3001\u4f46\u4e0d\u5339\u914d\u4efb\u4f55 <code class=\"option\">--exclude-extension</code> \u5f00\u5173\u7684\u6269\u5c55\u3002\u5982\u679c <code class=\"option\">--exclude-extension</code> \u5728\u6ca1\u6709 <code class=\"option\">-e</code> \u7684\u60c5\u51b5\u4e0b\u51fa\u73b0\uff0c\u90a3\u4e48\u5339\u914d <code class=\"option\">--exclude-extension</code> \u7684\u6269\u5c55\u4f1a\u4ece\u539f\u672c\u7684\u6b63\u5e38\u8f6c\u50a8\u4e2d\u6392\u9664\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f6c\u50a8\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u8be5\u6a21\u5f0f\u6309\u7167\u4e0e <code class=\"option\">-t</code> \u76f8\u540c\u7684\u89c4\u5219\u89e3\u91ca\u3002<code class=\"option\">--exclude-table-data</code> \u53ef\u4ee5\u7ed9\u51fa\u591a\u6b21\uff0c\u4ee5\u6392\u9664\u5339\u914d\u6240\u7ed9\u6a21\u5f0f\u4e2d\u4efb\u610f\u4e00\u4e2a\u7684\u8868\u3002\u5f53\u9700\u8981\u67d0\u4e2a\u7279\u5b9a\u8868\u7684\u5b9a\u4e49\u3001\u4f46\u4e0d\u9700\u8981\u5176\u4e2d\u6570\u636e\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u82e5\u8981\u6392\u9664\u6570\u636e\u5e93\u4e2d\u6240\u6709\u8868\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u89c1 <code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--exclude-table-data-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u6392\u9664\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--extra-float-digits=<em class=\"replaceable\"><code>ndigits</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u6d6e\u70b9\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684 <code class=\"option\">extra_float_digits</code> \u503c\uff0c\u800c\u4e0d\u662f\u6700\u5927\u53ef\u7528\u7cbe\u5ea6\u3002\u51fa\u4e8e\u5907\u4efd\u76ee\u7684\u7684\u5e38\u89c4\u8f6c\u50a8\u4e0d\u5e94\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--filter=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u4e00\u4e2a\u6587\u4ef6\u540d\uff0c\u4ece\u4e2d\u8bfb\u53d6\u8981\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u6216\u6392\u9664\u7684\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u3002\u6a21\u5f0f\u6309\u7167\u5bf9\u5e94\u9009\u9879\u7684\u540c\u6837\u89c4\u5219\u89e3\u91ca\uff1a\u5bf9\u4e8e\u8868\uff0c\u4f7f\u7528 <code class=\"option\">-t</code>/<code class=\"option\">--table</code>\u3001<code class=\"option\">--table-and-children</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u548c <code class=\"option\">--exclude-table-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6a21\u5f0f\uff0c\u4f7f\u7528 <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u548c <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--include-foreign-data</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u8868\u6570\u636e\uff0c\u4f7f\u7528 <code class=\"option\">--exclude-table-data</code> \u548c <code class=\"option\">--exclude-table-data-and-children</code> \u7684\u89c4\u5219\uff1b\u5bf9\u4e8e\u6269\u5c55\uff0c\u4f7f\u7528 <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u548c <code class=\"option\">--exclude-extension</code> \u7684\u89c4\u5219\u3002\u82e5\u8981\u4ece <code class=\"literal\">STDIN</code> \u8bfb\u53d6\uff0c\u8bf7\u4f7f\u7528 <code class=\"filename\">-</code> \u4f5c\u4e3a\u6587\u4ef6\u540d\u3002<code class=\"option\">--filter</code> \u9009\u9879\u53ef\u4ee5\u4e0e\u4e0a\u8ff0\u5305\u542b\u6216\u6392\u9664\u5bf9\u8c61\u7684\u9009\u9879\u4e00\u8d77\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u4e3a\u591a\u4e2a\u8fc7\u6ee4\u6587\u4ef6\u6307\u5b9a\u591a\u6b21\u3002</p>\n<p lang=\"zh\">\u6587\u4ef6\u6bcf\u884c\u5217\u51fa\u4e00\u4e2a\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a</p>\n<pre class=\"synopsis\">{ include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } <em class=\"replaceable\"><code>PATTERN</code></em>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e00\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u662f\u5305\u542b\u8fd8\u662f\u6392\u9664\u4e0e\u6a21\u5f0f\u5339\u914d\u7684\u5bf9\u8c61\u3002\u7b2c\u4e8c\u4e2a\u5173\u952e\u5b57\u6307\u5b9a\u8981\u7528\u8be5\u6a21\u5f0f\u8fc7\u6ee4\u7684\u5bf9\u8c61\u7c7b\u578b\uff1a</p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">extension</code>\uff1a\u6269\u5c55\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-e</code>/<code class=\"option\">--extension</code> \u6216 <code class=\"option\">--exclude-extension</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">foreign_data</code>\uff1a\u5916\u90e8\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--include-foreign-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">include</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table</code>\uff1a\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u6216 <code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_and_children</code>\uff1a\u8868\uff0c\u4ee5\u53ca\u5176\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--table-and-children</code> \u6216 <code class=\"option\">--exclude-table-and-children</code> \u9009\u9879\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">table_data_and_children</code>\uff1a\u4efb\u4f55\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u6570\u636e\uff0c\u4ee5\u53ca\u8fd9\u4e9b\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u7684\u6570\u636e\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">--exclude-table-data-and-children</code> \u9009\u9879\u3002\u8fd9\u4e2a\u5173\u952e\u5b57\u53ea\u80fd\u4e0e <code class=\"literal\">exclude</code> \u5173\u952e\u5b57\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</li>\n<li class=\"listitem\" lang=\"zh\">\n<p><code class=\"literal\">schema</code>\uff1a\u6a21\u5f0f\u3002\u4f5c\u7528\u7c7b\u4f3c <code class=\"option\">-n</code>/<code class=\"option\">--schema</code> \u6216 <code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code> \u9009\u9879\u3002</p>\n</li>\n</ul>\n</div>\n<p lang=\"zh\">\u4ee5 <code class=\"literal\">#</code> \u5f00\u5934\u7684\u884c\u88ab\u89c6\u4e3a\u6ce8\u91ca\u5e76\u5ffd\u7565\u3002\u6ce8\u91ca\u4e5f\u53ef\u4ee5\u653e\u5728\u5bf9\u8c61\u5339\u914d\u6a21\u5f0f\u884c\u4e4b\u540e\u3002\u7a7a\u767d\u884c\u540c\u6837\u4f1a\u88ab\u5ffd\u7565\u3002\u6709\u5173\u5982\u4f55\u5728\u5339\u914d\u6a21\u5f0f\u4e2d\u52a0\u5f15\u53f7\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\u3002</p>\n<p lang=\"zh\">\u793a\u4f8b\u6587\u4ef6\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/18/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u4e00\u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--if-exists</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528 <code class=\"literal\">DROP ... IF EXISTS</code> \u547d\u4ee4\u5728 <code class=\"option\">--clean</code> \u6a21\u5f0f\u4e0b\u5220\u9664\u5bf9\u8c61\u3002\u8fd9\u4f1a\u6291\u5236\u539f\u672c\u53ef\u80fd\u62a5\u544a\u7684<span class=\"quote\">\u201c<span class=\"quote\">does not exist</span>\u201d</span>\u9519\u8bef\u4fe1\u606f\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--clean</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--include-foreign-data=<em class=\"replaceable\"><code>foreignserver</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8f6c\u50a8\u4efb\u4f55\u5916\u90e8\u8868\u7684\u6570\u636e\uff0c\u53ea\u8981\u5176\u5916\u90e8\u670d\u52a1\u5668\u5339\u914d <em class=\"replaceable\"><code>foreignserver</code></em> \u6a21\u5f0f\u3002\u53ef\u4ee5\u901a\u8fc7\u5199\u591a\u4e2a <code class=\"option\">--include-foreign-data</code> \u5f00\u5173\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u6b64\u5916\uff0c<em class=\"replaceable\"><code>foreignserver</code></em> \u53c2\u6570\u6309\u7167 <span class=\"application\">psql</span> \u7684 <code class=\"literal\">\\d</code> \u547d\u4ee4\u6240\u4f7f\u7528\u7684\u540c\u6837\u89c4\u5219\u8fdb\u884c\u89e3\u91ca\uff08\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\uff0c\u56e0\u6b64\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5728\u6a21\u5f0f\u4e2d\u4f7f\u7528\u901a\u914d\u7b26\u6765\u9009\u62e9\u591a\u4e2a\u5916\u90e8\u670d\u52a1\u5668\u3002\u4f7f\u7528\u901a\u914d\u7b26\u65f6\uff0c\u5982\u6709\u9700\u8981\u8bf7\u5c0f\u5fc3\u4e3a\u6a21\u5f0f\u52a0\u5f15\u53f7\uff0c\u4ee5\u9632\u6b62 shell \u5c55\u5f00\u901a\u914d\u7b26\uff1b\u89c1\u4e0b\u6587\u7684<a class=\"xref\" href=\"/docs/18/app-pgdump.html#PG-DUMP-EXAMPLES\" title=\"\u793a\u4f8b\">\u793a\u4f8b</a>\u3002\u552f\u4e00\u7684\u4f8b\u5916\u662f\u4e0d\u5141\u8bb8\u7a7a\u6a21\u5f0f\u3002</p>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u5728 <code class=\"option\">--include-foreign-data</code> \u4e2d\u4f7f\u7528\u901a\u914d\u7b26\uff0c\u53ef\u80fd\u5bfc\u81f4\u8bbf\u95ee\u5230\u610f\u6599\u4e4b\u5916\u7684\u5916\u90e8\u670d\u52a1\u5668\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u5b89\u5168\u5730\u4f7f\u7528\u6b64\u9009\u9879\uff0c\u8bf7\u786e\u4fdd\u6240\u547d\u540d\u670d\u52a1\u5668\u7684\u6240\u6709\u8005\u662f\u53ef\u4fe1\u7684\u3002</p>\n</div>\n<div class=\"note\">\n<h3 class=\"title\" lang=\"zh\">\u6ce8\u610f</h3>\n<p lang=\"zh\">\u6307\u5b9a <code class=\"option\">--include-foreign-data</code> \u65f6\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u4f1a\u68c0\u67e5\u5916\u90e8\u8868\u662f\u5426\u53ef\u5199\u3002\u56e0\u6b64\uff0c\u4e0d\u80fd\u4fdd\u8bc1\u5916\u90e8\u8868\u8f6c\u50a8\u7684\u7ed3\u679c\u4e00\u5b9a\u80fd\u591f\u6210\u529f\u6062\u590d\u3002</p>\n</div>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--inserts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u628a\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u8fd9\u4f1a\u4f7f\u6062\u590d\u975e\u5e38\u7f13\u6162\uff1b\u5b83\u4e3b\u8981\u7528\u4e8e\u751f\u6210\u53ef\u88c5\u5165\u975e <span class=\"productname\">PostgreSQL</span> \u6570\u636e\u5e93\u7684\u8f6c\u50a8\u3002\u6062\u590d\u671f\u95f4\u53d1\u751f\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ea\u4f1a\u5bfc\u81f4\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u6240\u5305\u542b\u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4e2a\u8868\u5185\u5bb9\u4e22\u5931\u3002\u6ce8\u610f\uff0c\u5982\u679c\u91cd\u65b0\u5b89\u6392\u4e86\u5217\u987a\u5e8f\uff0c\u6062\u590d\u53ef\u80fd\u4f1a\u5f7b\u5e95\u5931\u8d25\u3002<code class=\"option\">--column-inserts</code> \u9009\u9879\u53ef\u4ee5\u907f\u514d\u5217\u987a\u5e8f\u53d8\u5316\u5e26\u6765\u7684\u95ee\u9898\uff0c\u4f46\u901f\u5ea6\u66f4\u6162\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--load-via-partition-root</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f53\u4e3a\u8868\u5206\u533a\u8f6c\u50a8\u6570\u636e\u65f6\uff0c\u8ba9 <code class=\"command\">COPY</code> \u6216 <code class=\"command\">INSERT</code> \u8bed\u53e5\u4ee5\u5305\u542b\u8be5\u5206\u533a\u7684\u5206\u533a\u5c42\u6b21\u7ed3\u6784\u6839\u4e3a\u76ee\u6807\uff0c\u800c\u4e0d\u662f\u4ee5\u8be5\u5206\u533a\u672c\u8eab\u4e3a\u76ee\u6807\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5728\u52a0\u8f7d\u6570\u636e\u65f6\u4e3a\u6bcf\u4e00\u884c\u91cd\u65b0\u786e\u5b9a\u9002\u5f53\u7684\u5206\u533a\u3002\u5f53\u5728\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u6062\u590d\u6570\u636e\uff0c\u800c\u884c\u5e76\u4e0d\u603b\u662f\u843d\u5728\u4e0e\u539f\u59cb\u670d\u52a1\u5668\u76f8\u540c\u7684\u5206\u533a\u4e2d\u65f6\uff0c\u8fd9\u53ef\u80fd\u5f88\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5206\u533a\u5217\u662f text \u7c7b\u578b\uff0c\u800c\u4e24\u4e2a\u7cfb\u7edf\u5bf9\u7528\u4e8e\u6392\u5e8f\u8be5\u5206\u533a\u5217\u7684\u6392\u5e8f\u89c4\u5219\u5b9a\u4e49\u4e0d\u540c\uff0c\u5c31\u53ef\u80fd\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--lock-wait-timeout=<em class=\"replaceable\"><code>timeout</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u5f00\u59cb\u65f6\uff0c\u4e0d\u8981\u65e0\u9650\u7b49\u5f85\u83b7\u53d6\u5171\u4eab\u8868\u9501\u3002\u5982\u679c\u65e0\u6cd5\u5728\u6307\u5b9a\u7684 <em class=\"replaceable\"><code>timeout</code></em> \u5185\u9501\u5b9a\u67d0\u4e2a\u8868\uff0c\u5c31\u8ba9\u8f6c\u50a8\u5931\u8d25\u3002\u8d85\u65f6\u53ef\u4ee5\u7528 <code class=\"command\">SET statement_timeout</code> \u63a5\u53d7\u7684\u4efb\u610f\u683c\u5f0f\u6307\u5b9a\u3002\uff08\u5141\u8bb8\u7684\u683c\u5f0f\u56e0\u88ab\u8f6c\u50a8\u6e90\u670d\u52a1\u5668\u7684\u7248\u672c\u800c\u5f02\uff0c\u4f46\u6240\u6709\u7248\u672c\u90fd\u63a5\u53d7\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\u7684\u6574\u6570\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-comments</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8 <code class=\"command\">COMMENT</code> \u547d\u4ee4\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u6570\u636e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-policies</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u884c\u5b89\u5168\u6027\u7b56\u7565\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-publications</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u53d1\u5e03\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-schema</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-security-labels</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u5b89\u5168\u6807\u7b7e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-statistics</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-subscriptions</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u8ba2\u9605\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-sync</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u7b49\u5f85\u6240\u6709\u6587\u4ef6\u90fd\u88ab\u5b89\u5168\u5199\u5165\u78c1\u76d8\u3002\u8be5\u9009\u9879\u4f1a\u4f7f <code class=\"command\">pg_dump</code> \u7acb\u5373\u8fd4\u56de\u800c\u4e0d\u7b49\u5f85\uff0c\u8fd9\u6837\u66f4\u5feb\uff0c\u4f46\u610f\u5473\u7740\u968f\u540e\u5982\u679c\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\uff0c\u8f6c\u50a8\u53ef\u80fd\u4f1a\u635f\u574f\u3002\u901a\u5e38\uff0c\u6b64\u9009\u9879\u9002\u7528\u4e8e\u6d4b\u8bd5\uff0c\u4f46\u4e0d\u5e94\u5728\u4ece\u751f\u4ea7\u5b89\u88c5\u8f6c\u50a8\u6570\u636e\u65f6\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-table-access-method</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u8bbf\u95ee\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u4f7f\u7528\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u8bbf\u95ee\u65b9\u6cd5\u521b\u5efa\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-tablespaces</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u8f93\u51fa\u7528\u4e8e\u9009\u62e9\u8868\u7a7a\u95f4\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5bf9\u8c61\u5728\u6062\u590d\u65f6\u90fd\u4f1a\u521b\u5efa\u5728\u5f53\u65f6\u9ed8\u8ba4\u7684\u8868\u7a7a\u95f4\u4e2d\u3002</p>\n<p lang=\"zh\">\u5f53\u751f\u6210\u4e00\u4e2a\u5f52\u6863\uff08\u975e\u6587\u672c\uff09\u8f93\u51fa\u6587\u4ef6\u65f6\uff0c\u6b64\u9009\u9879\u5c06\u88ab\u5ffd\u7565\u3002\u5bf9\u4e8e\u5f52\u6863\u683c\u5f0f\uff0c\u53ef\u4ee5\u5728\u8c03\u7528 <code class=\"command\">pg_restore</code> \u65f6\u6307\u5b9a\u8be5\u9009\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-toast-compression</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8f93\u51fa\u7528\u4e8e\u8bbe\u7f6e <acronym class=\"acronym\">TOAST</acronym> \u538b\u7f29\u65b9\u6cd5\u7684\u547d\u4ee4\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u6240\u6709\u5217\u90fd\u4f1a\u4ee5\u9ed8\u8ba4\u538b\u7f29\u8bbe\u7f6e\u6062\u590d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--no-unlogged-table-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4e0d\u8981\u8f6c\u50a8\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u7684\u5185\u5bb9\u3002\u6b64\u9009\u9879\u4e0d\u4f1a\u5f71\u54cd\u662f\u5426\u8f6c\u50a8\u8868\u548c\u5e8f\u5217\u7684\u5b9a\u4e49\uff08\u6a21\u5f0f\uff09\uff1b\u5b83\u53ea\u4f1a\u6291\u5236\u8868\u548c\u5e8f\u5217\u6570\u636e\u7684\u8f6c\u50a8\u3002\u4ece\u5907\u5e93\u8f6c\u50a8\u65f6\uff0c\u4e0d\u8bb0\u5f55 WAL \u7684\u8868\u548c\u5e8f\u5217\u4e2d\u7684\u6570\u636e\u59cb\u7ec8\u4f1a\u88ab\u6392\u9664\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--on-conflict-do-nothing</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6dfb\u52a0 <code class=\"literal\">ON CONFLICT DO NOTHING</code> \u5230 <code class=\"command\">INSERT</code> \u547d\u4ee4\u4e2d\u3002\u9664\u975e\u540c\u65f6\u6307\u5b9a\u4e86 <code class=\"option\">--inserts</code>\u3001<code class=\"option\">--column-inserts</code> \u6216 <code class=\"option\">--rows-per-insert</code>\uff0c\u5426\u5219\u6b64\u9009\u9879\u65e0\u6548\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--quote-all-identifiers</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5f3a\u5236\u4e3a\u6240\u6709\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u5f53\u4ece\u67d0\u4e2a\u670d\u52a1\u5668\u8f6c\u50a8\u6570\u636e\u5e93\uff0c\u800c\u8be5\u670d\u52a1\u5668\u7684 <span class=\"productname\">PostgreSQL</span> \u4e3b\u7248\u672c\u4e0e <span class=\"application\">pg_dump</span> \u4e0d\u540c\uff0c\u6216\u8005\u8f93\u51fa\u6253\u7b97\u88c5\u5165\u53e6\u4e00\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u65f6\uff0c\u63a8\u8350\u4f7f\u7528\u6b64\u9009\u9879\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<span class=\"application\">pg_dump</span> \u53ea\u4f1a\u4e3a\u5728\u5176\u81ea\u8eab\u4e3b\u7248\u672c\u4e2d\u5c5e\u4e8e\u4fdd\u7559\u5b57\u7684\u6807\u8bc6\u7b26\u52a0\u5f15\u53f7\u3002\u8fd9\u6709\u65f6\u4f1a\u5728\u5904\u7406\u5176\u4ed6\u7248\u672c\u670d\u52a1\u5668\u65f6\u5bfc\u81f4\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u7248\u672c\u7684\u4fdd\u7559\u5b57\u96c6\u5408\u53ef\u80fd\u7565\u6709\u4e0d\u540c\u3002\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u53ef\u4ee5\u9632\u6b62\u6b64\u7c7b\u95ee\u9898\uff0c\u4f46\u4ee3\u4ef7\u662f\u8f6c\u50a8\u811a\u672c\u66f4\u96be\u9605\u8bfb\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--restrict-key=<em class=\"replaceable\"><code>restrict_key</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u8f93\u51fa\u4e2d\uff0c\u628a\u7ed9\u5b9a\u5b57\u7b26\u4e32\u7528\u4f5c <span class=\"application\">psql</span> \u7684 <code class=\"command\">\\restrict</code> \u952e\u3002\u6b64\u9009\u9879\u53ea\u80fd\u7528\u4e8e\u7eaf\u6587\u672c\u8f6c\u50a8\uff0c\u4e5f\u5c31\u662f <code class=\"option\">--format</code> \u88ab\u8bbe\u7f6e\u4e3a <code class=\"literal\">plain</code>\uff0c\u6216\u8005\u7701\u7565\u4e86 <code class=\"option\">--format</code> \u9009\u9879\u65f6\u3002\u82e5\u672a\u6307\u5b9a\u8be5\u952e\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u6309\u9700\u8981\u968f\u673a\u751f\u6210\u4e00\u4e2a\u3002\u952e\u53ea\u80fd\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u6d4b\u8bd5\u4ee5\u53ca\u5176\u4ed6\u9700\u8981\u53ef\u91cd\u590d\u8f93\u51fa\u7684\u573a\u666f\uff08\u4f8b\u5982\u6bd4\u8f83\u8f6c\u50a8\u6587\u4ef6\uff09\u3002\u4e00\u822c\u4e0d\u5efa\u8bae\u4f7f\u7528\u5b83\uff0c\u56e0\u4e3a\u82e5\u6076\u610f\u670d\u52a1\u5668\u4e8b\u5148\u77e5\u9053\u8be5\u952e\uff0c\u53ef\u80fd\u80fd\u591f\u6ce8\u5165\u4efb\u610f\u4ee3\u7801\uff0c\u5e76\u5728\u8fd0\u884c <span class=\"application\">psql</span> \u5904\u7406\u8f6c\u50a8\u8f93\u51fa\u7684\u673a\u5668\u4e0a\u6267\u884c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--rows-per-insert=<em class=\"replaceable\"><code>nrows</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6570\u636e\u8f6c\u50a8\u4e3a <code class=\"command\">INSERT</code> \u547d\u4ee4\uff08\u800c\u4e0d\u662f <code class=\"command\">COPY</code>\uff09\u3002\u5b83\u63a7\u5236\u6bcf\u4e2a <code class=\"command\">INSERT</code> \u547d\u4ee4\u7684\u6700\u5927\u884c\u6570\u3002\u6307\u5b9a\u7684\u503c\u5fc5\u987b\u662f\u5927\u4e8e\u96f6\u7684\u6570\u5b57\u3002\u6062\u590d\u8fc7\u7a0b\u4e2d\u7684\u4efb\u4f55\u9519\u8bef\u5c06\u5bfc\u81f4\u53ea\u6709\u5c5e\u4e8e\u6709\u95ee\u9898\u7684 <code class=\"command\">INSERT</code> \u7684\u884c\u4e22\u5931\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u8868\u7684\u5185\u5bb9\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--section=<em class=\"replaceable\"><code>sectionname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u4ec5\u8f6c\u50a8\u6307\u5b9a\u7684\u90e8\u5206\u3002\u90e8\u5206\u540d\u79f0\u53ef\u4ee5\u662f <code class=\"option\">pre-data</code>\u3001<code class=\"option\">data</code> \u6216 <code class=\"option\">post-data</code>\u3002\u53ef\u4ee5\u591a\u6b21\u6307\u5b9a\u6b64\u9009\u9879\u4ee5\u9009\u62e9\u591a\u4e2a\u90e8\u5206\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u8f6c\u50a8\u6240\u6709\u90e8\u5206\u3002</p>\n<p lang=\"zh\">\u6570\u636e\u90e8\u5206\u5305\u542b\u5b9e\u9645\u7684\u8868\u6570\u636e\u3001\u5927\u5bf9\u8c61\u5185\u5bb9\u3001\u5e8f\u5217\u503c\uff0c\u4ee5\u53ca\u8868\u3001\u7269\u5316\u89c6\u56fe\u548c\u5916\u90e8\u8868\u7684\u7edf\u8ba1\u4fe1\u606f\u3002post-data \u90e8\u5206\u5305\u62ec\u7d22\u5f15\u3001\u89e6\u53d1\u5668\u3001\u89c4\u5219\u3001\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\uff0c\u4ee5\u53ca\u9664\u5df2\u9a8c\u8bc1\u7684\u68c0\u67e5\u7ea6\u675f\u548c\u975e\u7a7a\u7ea6\u675f\u4e4b\u5916\u7684\u5176\u4ed6\u7ea6\u675f\u5b9a\u4e49\u3002pre-data \u90e8\u5206\u5305\u62ec\u6240\u6709\u5176\u4ed6\u6570\u636e\u5b9a\u4e49\u9879\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sequence-data</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u8f6c\u50a8\u4e2d\u5305\u542b\u5e8f\u5217\u6570\u636e\u3002\u9664\u975e\u6307\u5b9a\u4e86 <code class=\"option\">--no-data</code>\u3001<code class=\"option\">--schema-only</code> \u6216 <code class=\"option\">--statistics-only</code>\uff0c\u5426\u5219\u8fd9\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--serializable-deferrable</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4f7f\u7528 <code class=\"literal\">serializable</code> \u4e8b\u52a1\u6765\u6267\u884c\u8f6c\u50a8\uff0c\u4ee5\u786e\u4fdd\u6240\u7528\u5feb\u7167\u4e0e\u540e\u7eed\u6570\u636e\u5e93\u72b6\u6001\u4e00\u81f4\uff1b\u4f46\u8fd9\u662f\u901a\u8fc7\u7b49\u5f85\u4e8b\u52a1\u6d41\u5230\u8fbe\u4e00\u4e2a\u4e0d\u4f1a\u51fa\u73b0\u5f02\u5e38\u7684\u65f6\u70b9\u6765\u5b9e\u73b0\u7684\uff0c\u4ece\u800c\u907f\u514d\u8f6c\u50a8\u5931\u8d25\u6216\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u56e0 <code class=\"literal\">serialization_failure</code> \u800c\u56de\u6eda\u3002\u6709\u5173\u4e8b\u52a1\u9694\u79bb\u548c\u5e76\u53d1\u63a7\u5236\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/mvcc.html\" title=\"\u7b2c\u00a013\u00a0\u7ae0\u00a0\u5e76\u53d1\u63a7\u5236\">\u7b2c\u00a013\u00a0\u7ae0</a>\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u5bf9\u4e8e\u4ec5\u7528\u4e8e\u707e\u96be\u6062\u590d\u7684\u8f6c\u50a8\u6ca1\u6709\u597d\u5904\u3002\u4f46\u5bf9\u4e8e\u7528\u6765\u52a0\u8f7d\u6570\u636e\u5e93\u526f\u672c\uff0c\u4ee5\u4f9b\u62a5\u8868\u6216\u5176\u4ed6\u53ea\u8bfb\u8d1f\u8f7d\u5171\u4eab\uff0c\u800c\u539f\u59cb\u6570\u636e\u5e93\u7ee7\u7eed\u66f4\u65b0\u7684\u8f6c\u50a8\uff0c\u5b83\u53ef\u80fd\u6709\u7528\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u5b83\uff0c\u8f6c\u50a8\u53ef\u80fd\u53cd\u6620\u51fa\u4e00\u79cd\u4e0e\u6700\u7ec8\u63d0\u4ea4\u4e8b\u52a1\u7684\u4efb\u4f55\u4e32\u884c\u6267\u884c\u90fd\u4e0d\u4e00\u81f4\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\u6279\u5904\u7406\u6280\u672f\uff0c\u8f6c\u50a8\u4e2d\u53ef\u80fd\u663e\u793a\u67d0\u4e2a\u6279\u6b21\u5df2\u7ecf\u5173\u95ed\uff0c\u4f46\u6279\u6b21\u4e2d\u7684\u5168\u90e8\u6761\u76ee\u5374\u5e76\u672a\u51fa\u73b0\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u5728\u542f\u52a8 pg_dump \u65f6\u6ca1\u6709\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u6b64\u9009\u9879\u4e0d\u4f1a\u5e26\u6765\u4efb\u4f55\u5dee\u522b\u3002\u5982\u679c\u5b58\u5728\u6d3b\u52a8\u7684\u8bfb\u5199\u4e8b\u52a1\uff0c\u8f6c\u50a8\u5f00\u59cb\u65f6\u95f4\u53ef\u80fd\u4f1a\u88ab\u5ef6\u8fdf\u4e00\u4e2a\u4e0d\u786e\u5b9a\u7684\u65f6\u957f\u3002\u4e00\u65e6\u5f00\u59cb\u8fd0\u884c\uff0c\u4f7f\u7528\u6216\u4e0d\u4f7f\u7528\u8be5\u5f00\u5173\u7684\u6027\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--snapshot=<em class=\"replaceable\"><code>snapshotname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728\u5236\u4f5c\u6570\u636e\u5e93\u8f6c\u50a8\u65f6\uff0c\u4f7f\u7528\u6307\u5b9a\u7684\u540c\u6b65\u5feb\u7167\uff08\u8be6\u89c1<a class=\"xref\" href=\"/docs/18/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION-TABLE\" title=\"\u8868\u00a09.100.\u00a0\u5feb\u7167\u540c\u6b65\u51fd\u6570\">\u8868\u00a09.100</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5f53\u9700\u8981\u5c06\u8f6c\u50a8\u4e0e\u903b\u8f91\u590d\u5236\u69fd\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/logicaldecoding.html\" title=\"\u7b2c\u00a047\u00a0\u7ae0\u00a0\u903b\u8f91\u89e3\u7801\">\u7b2c\u00a047\u00a0\u7ae0</a>\uff09\u6216\u4e0e\u5e76\u53d1\u4f1a\u8bdd\u540c\u6b65\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n<p lang=\"zh\">\u5728\u5e76\u884c\u8f6c\u50a8\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06\u4f7f\u7528\u6b64\u9009\u9879\u5b9a\u4e49\u7684\u5feb\u7167\u540d\u79f0\uff0c\u800c\u4e0d\u662f\u91cd\u65b0\u83b7\u53d6\u4e00\u4e2a\u65b0\u5feb\u7167\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--statistics</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f6c\u50a8\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--statistics-only</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u8f6c\u50a8\u7edf\u8ba1\u4fe1\u606f\uff0c\u4e0d\u8f6c\u50a8\u6a21\u5f0f\uff08\u6570\u636e\u5b9a\u4e49\uff09\u6216\u6570\u636e\u3002\u4f1a\u8f6c\u50a8\u8868\u3001\u7269\u5316\u89c6\u56fe\u3001\u5916\u90e8\u8868\u548c\u7d22\u5f15\u7684\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--strict-names</code></span></dt>\n<dd>\n<p lang=\"zh\">\u8981\u6c42\u6bcf\u4e2a\u6269\u5c55\uff08<code class=\"option\">-e</code>/<code class=\"option\">--extension</code>\uff09\u3001\u6a21\u5f0f\uff08<code class=\"option\">-n</code>/<code class=\"option\">--schema</code>\uff09\u548c\u8868\uff08<code class=\"option\">-t</code>/<code class=\"option\">--table</code>\uff09\u6a21\u5f0f\u5728\u8981\u8f6c\u50a8\u7684\u6570\u636e\u5e93\u4e2d\u81f3\u5c11\u5339\u914d\u4e00\u4e2a\u6269\u5c55/\u6a21\u5f0f/\u8868\u3002\u8fd9\u4e5f\u9002\u7528\u4e8e\u914d\u5408 <code class=\"option\">--filter</code> \u4f7f\u7528\u7684\u8fc7\u6ee4\u5668\u3002\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u6240\u6709\u6269\u5c55/\u6a21\u5f0f/\u8868\u6a21\u5f0f\u90fd\u627e\u4e0d\u5230\u5339\u914d\u9879\uff0c\u90a3\u4e48 <span class=\"application\">pg_dump</span> \u5373\u4f7f\u5728\u4e0d\u4f7f\u7528 <code class=\"option\">--strict-names</code> \u7684\u60c5\u51b5\u4e0b\u4e5f\u4f1a\u62a5\u9519\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5bf9 <code class=\"option\">--exclude-extension</code>\u3001<code class=\"option\">-N</code>/<code class=\"option\">--exclude-schema</code>\u3001<code class=\"option\">-T</code>/<code class=\"option\">--exclude-table</code> \u6216 <code class=\"option\">--exclude-table-data</code> \u6ca1\u6709\u6548\u679c\u3002\u672a\u5339\u914d\u4efb\u4f55\u5bf9\u8c61\u7684\u6392\u9664\u6a21\u5f0f\u4e0d\u4f1a\u88ab\u89c6\u4e3a\u9519\u8bef\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--sync-method=<em class=\"replaceable\"><code>method</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f53\u8bbe\u4e3a <code class=\"literal\">fsync</code> \u65f6\uff08\u8fd9\u662f\u9ed8\u8ba4\u503c\uff09\uff0c<code class=\"command\">pg_dump --format=directory</code> \u4f1a\u9012\u5f52\u6253\u5f00\u5e76\u540c\u6b65\u5f52\u6863\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u3002</p>\n<p lang=\"zh\">\u5728 Linux \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u6539\u7528 <code class=\"literal\">syncfs</code>\uff0c\u8ba9\u64cd\u4f5c\u7cfb\u7edf\u540c\u6b65\u5305\u542b\u5f52\u6863\u76ee\u5f55\u7684\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u3002\u5173\u4e8e\u9700\u8981\u6ce8\u610f\u7684\u95ee\u9898\uff0c\u8bf7\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\">recovery_init_sync_method</a>\u4e2d\u6709\u5173\u4f7f\u7528 <code class=\"literal\">syncfs</code> \u7684\u4fe1\u606f\u3002</p>\n<p lang=\"zh\">\u5f53\u4f7f\u7528 <code class=\"option\">--no-sync</code>\uff0c\u6216 <code class=\"option\">--format</code> \u672a\u8bbe\u4e3a <code class=\"literal\">directory</code> \u65f6\uff0c\u6b64\u9009\u9879\u6ca1\u6709\u6548\u679c\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--table-and-children=<em class=\"replaceable\"><code>pattern</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8fd9\u4e0e <code class=\"option\">-t</code>/<code class=\"option\">--table</code> \u9009\u9879\u76f8\u540c\uff0c\u53ea\u662f\u5b83\u8fd8\u4f1a\u5305\u542b\u5339\u914d <em class=\"replaceable\"><code>pattern</code></em> \u7684\u8868\u7684\u4efb\u4f55\u5206\u533a\u6216\u7ee7\u627f\u5b50\u8868\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--use-set-session-authorization</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8f93\u51fa\u7b26\u5408 SQL \u6807\u51c6\u7684 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u547d\u4ee4\uff0c\u800c\u4e0d\u662f <code class=\"command\">ALTER OWNER</code> \u547d\u4ee4\u6765\u786e\u5b9a\u5bf9\u8c61\u6240\u6709\u6743\u3002\u8fd9\u4f1a\u8ba9\u8f6c\u50a8\u66f4\u7b26\u5408\u6807\u51c6\uff0c\u4f46\u6839\u636e\u8f6c\u50a8\u4e2d\u5bf9\u8c61\u7684\u5386\u53f2\uff0c\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u6062\u590d\u3002\u53e6\u5916\uff0c\u4f7f\u7528 <code class=\"command\">SET SESSION AUTHORIZATION</code> \u7684\u8f6c\u50a8\u80af\u5b9a\u9700\u8981\u8d85\u7ea7\u7528\u6237\u6743\u9650\u624d\u80fd\u6b63\u786e\u6062\u590d\uff0c\u800c <code class=\"command\">ALTER OWNER</code> \u53ea\u9700\u8f83\u4f4e\u6743\u9650\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-?</code><br/></span><span class=\"term\"><code class=\"option\">--help</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u663e\u793a\u5173\u4e8e <span class=\"application\">pg_dump</span> \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u4fe1\u606f\uff0c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4ee5\u4e0b\u547d\u4ee4\u884c\u9009\u9879\u63a7\u5236\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>dbname</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--dbname=<em class=\"replaceable\"><code>dbname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u7b49\u4ef7\u4e8e\u5728\u547d\u4ee4\u884c\u4e0a\u628a <em class=\"replaceable\"><code>dbname</code></em> \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u975e\u9009\u9879\u53c2\u6570\u6307\u5b9a\u3002<em class=\"replaceable\"><code>dbname</code></em> \u53ef\u4ee5\u662f<a class=\"link\" href=\"/docs/18/libpq-connect.html#LIBPQ-CONNSTRING\" title=\"32.1.1.\u00a0\u8fde\u63a5\u5b57\u7b26\u4e32\">\u8fde\u63a5\u5b57\u7b26\u4e32</a>\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u8fde\u63a5\u5b57\u7b26\u4e32\u4e2d\u7684\u53c2\u6570\u5c06\u8986\u76d6\u4efb\u4f55\u51b2\u7a81\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>host</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--host=<em class=\"replaceable\"><code>host</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6240\u5728\u673a\u5668\u7684\u4e3b\u673a\u540d\u3002\u5982\u679c\u503c\u4ee5\u659c\u6760\u5f00\u5934\uff0c\u5219\u88ab\u7528\u4f5c Unix \u57df\u5957\u63a5\u5b57\u7684\u76ee\u5f55\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGHOST</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u5c1d\u8bd5\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--port=<em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u670d\u52a1\u5668\u6b63\u5728\u76d1\u542c\u8fde\u63a5\u7684 TCP \u7aef\u53e3\uff0c\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea <code class=\"envar\">PGPORT</code> \u73af\u5883\u53d8\u91cf\uff08\u5982\u679c\u5df2\u8bbe\u7f6e\uff09\uff0c\u5426\u5219\u4f7f\u7528\u7f16\u8bd1\u65f6\u9ed8\u8ba4\u503c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--username=<em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fde\u63a5\u7684\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--no-password</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7edd\u4e0d\u53d1\u51fa\u5bc6\u7801\u63d0\u793a\u3002\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c\u800c\u53c8\u65e0\u6cd5\u901a\u8fc7 <code class=\"filename\">.pgpass</code> \u6587\u4ef6\u7b49\u5176\u4ed6\u65b9\u5f0f\u83b7\u5f97\u5bc6\u7801\uff0c\u5219\u8fde\u63a5\u5c1d\u8bd5\u5c06\u5931\u8d25\u3002\u5728\u6ca1\u6709\u7528\u6237\u5728\u573a\u8f93\u5165\u5bc6\u7801\u7684\u6279\u5904\u7406\u4f5c\u4e1a\u548c\u811a\u672c\u4e2d\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--password</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5f3a\u5236 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u4e4b\u524d\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002</p>\n<p lang=\"zh\">\u8fd9\u4e2a\u9009\u9879\u7edd\u975e\u5fc5\u9700\uff0c\u56e0\u4e3a\u5982\u679c\u670d\u52a1\u5668\u8981\u6c42\u5bc6\u7801\u8ba4\u8bc1\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u81ea\u52a8\u63d0\u793a\u8f93\u5165\u5bc6\u7801\u3002\u4e0d\u8fc7\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5148\u6d6a\u8d39\u4e00\u6b21\u8fde\u63a5\u5c1d\u8bd5\u6765\u53d1\u73b0\u670d\u52a1\u5668\u9700\u8981\u5bc6\u7801\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u503c\u5f97\u8f93\u5165 <code class=\"option\">-W</code>\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u8fd9\u6b21\u989d\u5916\u7684\u8fde\u63a5\u5c1d\u8bd5\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--role=<em class=\"replaceable\"><code>rolename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7528\u4e8e\u521b\u5efa\u8f6c\u50a8\u7684\u89d2\u8272\u540d\u79f0\u3002\u6b64\u9009\u9879\u4f1a\u8ba9 <span class=\"application\">pg_dump</span> \u5728\u8fde\u63a5\u6570\u636e\u5e93\u540e\u53d1\u51fa <code class=\"command\">SET ROLE</code> <em class=\"replaceable\"><code>rolename</code></em> \u547d\u4ee4\u3002\u5f53\u5df2\u8ba4\u8bc1\u7528\u6237\uff08\u7531 <code class=\"option\">-U</code> \u6307\u5b9a\uff09\u7f3a\u5c11 <span class=\"application\">pg_dump</span> \u6240\u9700\u6743\u9650\uff0c\u4f46\u53ef\u4ee5\u5207\u6362\u5230\u5177\u6709\u6240\u9700\u6743\u9650\u7684\u89d2\u8272\u65f6\uff0c\u6b64\u9009\u9879\u5f88\u6709\u7528\u3002\u6709\u4e9b\u5b89\u88c5\u73af\u5883\u6709\u7981\u6b62\u76f4\u63a5\u4ee5\u8d85\u7ea7\u7528\u6237\u767b\u5f55\u7684\u7b56\u7565\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fdd\u53cd\u8be5\u7b56\u7565\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGDATABASE</code><br/></span><span class=\"term\"><code class=\"envar\">PGHOST</code><br/></span><span class=\"term\"><code class=\"envar\">PGOPTIONS</code><br/></span><span class=\"term\"><code class=\"envar\">PGPORT</code><br/></span><span class=\"term\"><code class=\"envar\">PGUSER</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u8fde\u63a5\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PG_COLOR</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8bca\u65ad\u6d88\u606f\u662f\u5426\u4f7f\u7528\u989c\u8272\u3002\u53ef\u9009\u503c\u4e3a <code class=\"literal\">always</code>\u3001<code class=\"literal\">auto</code>\u548c <code class=\"literal\">never</code>\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u4e0e\u5927\u591a\u6570\u5176\u4ed6 <span class=\"productname\">PostgreSQL</span> \u5de5\u5177\u4e00\u6837\uff0c\u6b64\u5de5\u5177\u4e5f\u4f7f\u7528 <span class=\"application\">libpq</span> \u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u89c1<a class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a032.15\u00a0\u8282</a>\uff09\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PGDUMP-DIAGNOSTICS\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u5728\u5185\u90e8\u6267\u884c <code class=\"command\">SELECT</code> \u8bed\u53e5\u3002\u5982\u679c\u8fd0\u884c <span class=\"application\">pg_dump</span> \u65f6\u9047\u5230\u95ee\u9898\uff0c\u8bf7\u786e\u8ba4\u80fd\u591f\u4f8b\u5982\u4f7f\u7528<a class=\"xref\" href=\"/docs/18/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a>\u4ece\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\u4fe1\u606f\u3002\u6b64\u5916\uff0c<span class=\"application\">libpq</span> \u524d\u7aef\u5e93\u6240\u4f7f\u7528\u7684\u4efb\u4f55\u9ed8\u8ba4\u8fde\u63a5\u8bbe\u7f6e\u548c\u73af\u5883\u53d8\u91cf\u4e5f\u90fd\u4f1a\u751f\u6548\u3002</p>\n<p lang=\"zh\"><span class=\"application\">pg_dump</span> \u7684\u6570\u636e\u5e93\u6d3b\u52a8\u901a\u5e38\u4f1a\u88ab\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u3002\u5982\u679c\u4e0d\u5e0c\u671b\u5982\u6b64\uff0c\u53ef\u4ee5\u5c06\u53c2\u6570 <code class=\"varname\">track_counts</code> \u901a\u8fc7 <code class=\"envar\">PGOPTIONS</code> \u6216 <code class=\"literal\">ALTER USER</code> \u547d\u4ee4\u8bbe\u7f6e\u4e3a false\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-NOTES\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5982\u679c\u6570\u636e\u5e93\u96c6\u7c07\u5728 <code class=\"literal\">template1</code> \u6570\u636e\u5e93\u4e2d\u6709\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u5185\u5bb9\uff0c\u8981\u5c0f\u5fc3\u628a <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u6062\u590d\u5230\u4e00\u4e2a\u771f\u6b63\u7a7a\u7684\u6570\u636e\u5e93\u4e2d\uff1b\u5426\u5219\u5f88\u53ef\u80fd\u56e0\u4e3a\u8fd9\u4e9b\u65b0\u589e\u5bf9\u8c61\u7684\u91cd\u590d\u5b9a\u4e49\u800c\u62a5\u9519\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u4e0d\u542b\u4efb\u4f55\u672c\u5730\u6dfb\u52a0\u7684\u7a7a\u6570\u636e\u5e93\uff0c\u5e94\u4ece <code class=\"literal\">template0</code> \u800c\u4e0d\u662f <code class=\"literal\">template1</code> \u590d\u5236\uff0c\u4f8b\u5982\uff1a</p>\n<pre class=\"programlisting\">CREATE DATABASE foo WITH TEMPLATE template0;\n</pre>\n<p lang=\"zh\">\u5f53\u9009\u62e9\u4e0d\u5305\u542b\u6a21\u5f0f\u7684\u8f6c\u50a8\u5e76\u4f7f\u7528 <code class=\"option\">--disable-triggers</code> \u9009\u9879\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u5728\u63d2\u5165\u6570\u636e\u524d\u53d1\u51fa\u547d\u4ee4\u7981\u7528\u7528\u6237\u8868\u4e0a\u7684\u89e6\u53d1\u5668\uff0c\u5e76\u5728\u6570\u636e\u63d2\u5165\u5b8c\u6210\u540e\u53d1\u51fa\u547d\u4ee4\u91cd\u65b0\u542f\u7528\u5b83\u4eec\u3002\u5982\u679c\u6062\u590d\u5728\u4e2d\u9014\u505c\u6b62\uff0c\u7cfb\u7edf\u76ee\u5f55\u53ef\u80fd\u4f1a\u4fdd\u6301\u5728\u9519\u8bef\u72b6\u6001\u3002</p>\n<p lang=\"zh\">\u5f53\u6307\u5b9a <code class=\"option\">--statistics</code> \u65f6\uff0c<code class=\"command\">pg_dump</code> \u4f1a\u5728\u751f\u6210\u7684\u8f6c\u50a8\u6587\u4ef6\u4e2d\u5305\u542b\u5927\u591a\u6570\u4f18\u5316\u5668\u7edf\u8ba1\u4fe1\u606f\u3002\u4f46\u8fd9\u5e76\u4e0d\u5305\u62ec\u6240\u6709\u7edf\u8ba1\u4fe1\u606f\uff0c\u4f8b\u5982\u901a\u8fc7<a class=\"xref\" href=\"/docs/18/sql-createstatistics.html\" title=\"CREATE STATISTICS\"><span class=\"refentrytitle\">CREATE STATISTICS</span></a>\u663e\u5f0f\u521b\u5efa\u7684\u7edf\u8ba1\u4fe1\u606f\u3001\u6269\u5c55\u6dfb\u52a0\u7684\u81ea\u5b9a\u4e49\u7edf\u8ba1\u4fe1\u606f\uff0c\u6216\u7531\u7d2f\u79ef\u7edf\u8ba1\u7cfb\u7edf\u6536\u96c6\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u56e0\u6b64\uff0c\u4ece\u8f6c\u50a8\u6587\u4ef6\u6062\u590d\u540e\u518d\u8fd0\u884c <code class=\"command\">ANALYZE</code> \u4ee5\u786e\u4fdd\u6700\u4f73\u6027\u80fd\uff0c\u53ef\u80fd\u4ecd\u7136\u6709\u7528\uff1b\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/18/routine-vacuuming.html#VACUUM-FOR-STATISTICS\" title=\"24.1.3.\u00a0\u66f4\u65b0\u89c4\u5212\u5668\u7edf\u8ba1\u4fe1\u606f\">\u7b2c\u00a024.1.3\u00a0\u8282</a>\u548c<a class=\"xref\" href=\"/docs/18/routine-vacuuming.html#AUTOVACUUM\" title=\"24.1.6.\u00a0\u81ea\u52a8\u6e05\u7406\u5b88\u62a4\u8fdb\u7a0b\">\u7b2c\u00a024.1.6\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u7531\u4e8e <span class=\"application\">pg_dump</span> \u5e38\u88ab\u7528\u6765\u628a\u6570\u636e\u8fc1\u79fb\u5230\u66f4\u65b0\u7248\u672c\u7684 <span class=\"productname\">PostgreSQL</span>\uff0c\u56e0\u6b64\u901a\u5e38\u53ef\u4ee5\u671f\u671b <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e2d\uff0c\u800c\u8fd9\u4e9b\u670d\u52a1\u5668\u7684\u7248\u672c\u6bd4 <span class=\"application\">pg_dump</span> \u66f4\u9ad8\u3002<span class=\"application\">pg_dump</span> \u4e5f\u53ef\u4ee5\u4ece\u7248\u672c\u6bd4\u5b83\u81ea\u8eab\u66f4\u65e7\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\u6570\u636e\u3002\uff08\u76ee\u524d\u652f\u6301\u56de\u6eaf\u5230 9.2 \u7248\u7684\u670d\u52a1\u5668\u3002\uff09\u7136\u800c\uff0c<span class=\"application\">pg_dump</span> \u4e0d\u80fd\u4ece\u4e3b\u7248\u672c\u9ad8\u4e8e\u5b83\u81ea\u8eab\u7684 <span class=\"productname\">PostgreSQL</span> \u670d\u52a1\u5668\u4e0a\u8f6c\u50a8\uff1b\u5b83\u751a\u81f3\u4f1a\u62d2\u7edd\u5c1d\u8bd5\uff0c\u4ee5\u514d\u5192\u751f\u6210\u65e0\u6548\u8f6c\u50a8\u7684\u98ce\u9669\u3002\u53e6\u5916\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1 <span class=\"application\">pg_dump</span> \u7684\u8f93\u51fa\u80fd\u591f\u88c5\u8f7d\u5230\u66f4\u65e7\u4e3b\u7248\u672c\u7684\u670d\u52a1\u5668\u4e0a \u2014 \u5373\u4f7f\u8f6c\u50a8\u6b63\u662f\u4ece\u8be5\u7248\u672c\u670d\u52a1\u5668\u4e0a\u53d6\u5f97\u7684\u3002\u628a\u8f6c\u50a8\u6587\u4ef6\u88c5\u8f7d\u5230\u8f83\u65e7\u670d\u52a1\u5668\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u624b\u5de5\u7f16\u8f91\u8f6c\u50a8\u6587\u4ef6\uff0c\u79fb\u9664\u65e7\u670d\u52a1\u5668\u65e0\u6cd5\u7406\u89e3\u7684\u8bed\u6cd5\u3002\u5728\u8de8\u7248\u672c\u573a\u666f\u4e2d\uff0c\u5efa\u8bae\u4f7f\u7528 <code class=\"option\">--quote-all-identifiers</code> \u9009\u9879\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u9632\u6b62\u4e0d\u540c <span class=\"productname\">PostgreSQL</span> \u7248\u672c\u4fdd\u7559\u5b57\u5217\u8868\u5dee\u5f02\u5e26\u6765\u7684\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u5728\u8f6c\u50a8\u903b\u8f91\u590d\u5236\u8ba2\u9605\u65f6\uff0c<span class=\"application\">pg_dump</span> \u4f1a\u751f\u6210 <code class=\"command\">CREATE SUBSCRIPTION</code> \u547d\u4ee4\uff0c\u5e76\u5e26\u4e0a <code class=\"literal\">connect = false</code> \u9009\u9879\uff0c\u8fd9\u6837\u6062\u590d\u8ba2\u9605\u65f6\u5c31\u4e0d\u4f1a\u4e3a\u4e86\u521b\u5efa\u590d\u5236\u69fd\u6216\u6267\u884c\u521d\u59cb\u8868\u590d\u5236\u800c\u5efa\u7acb\u8fdc\u7a0b\u8fde\u63a5\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u65e0\u9700\u7f51\u7edc\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u4e5f\u80fd\u6062\u590d\u8f6c\u50a8\u3002\u968f\u540e\u7531\u7528\u6237\u4ee5\u9002\u5f53\u65b9\u5f0f\u91cd\u65b0\u6fc0\u6d3b\u8ba2\u9605\u3002\u5982\u679c\u6d89\u53ca\u7684\u4e3b\u673a\u5df2\u7ecf\u53d8\u5316\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4fee\u6539\u8fde\u63a5\u4fe1\u606f\u3002\u5728\u5f00\u59cb\u4e00\u6b21\u65b0\u7684\u5b8c\u6574\u8868\u590d\u5236\u4e4b\u524d\uff0c\u53ef\u80fd\u4e5f\u9002\u5408\u5148\u622a\u65ad\u76ee\u6807\u8868\u3002\u5982\u679c\u7528\u6237\u6253\u7b97\u5728\u5237\u65b0\u671f\u95f4\u590d\u5236\u521d\u59cb\u6570\u636e\uff0c\u5219\u5fc5\u987b\u4ee5 <code class=\"literal\">two_phase = false</code> \u521b\u5efa\u8be5\u69fd\u3002\u521d\u59cb\u540c\u6b65\u4e4b\u540e\uff0c\u8ba2\u9605\u8005\u4f1a\u81ea\u52a8\u542f\u7528 <a class=\"link\" href=\"/docs/18/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-PARAMS-WITH-TWO-PHASE\"><code class=\"literal\">two_phase</code></a> \u9009\u9879\uff0c\u524d\u63d0\u662f\u8be5\u8ba2\u9605\u6700\u521d\u662f\u4ee5 <code class=\"literal\">two_phase = true</code> \u9009\u9879\u521b\u5efa\u7684\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5efa\u8bae\u5728\u6062\u590d\u6570\u636e\u5e93\u65f6\u4f7f\u7528 <code class=\"option\">-X</code>\uff08<code class=\"option\">--no-psqlrc</code>\uff09\u9009\u9879\u6765\u5904\u7406\u7eaf\u6587\u672c <span class=\"application\">pg_dump</span> \u811a\u672c\uff0c\u4ee5\u786e\u4fdd\u6062\u590d\u8fc7\u7a0b\u5e72\u51c0\uff0c\u5e76\u9632\u6b62\u4e0e\u975e\u9ed8\u8ba4 <span class=\"application\">psql</span> \u914d\u7f6e\u53d1\u751f\u6f5c\u5728\u51b2\u7a81\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"PG-DUMP-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u628a\u6570\u636e\u5e93 <code class=\"literal\">mydb</code> \u8f6c\u50a8\u5230\u4e00\u4e2a SQL \u811a\u672c\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u8fd9\u6837\u7684\u811a\u672c\u91cd\u65b0\u88c5\u5165\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -X -d newdb -f db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a custom \u683c\u5f0f\u5f52\u6863\u6587\u4ef6\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fc mydb &gt; db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528 5 \u4e2a\u5e76\u884c\u5de5\u4f5c\u4efb\u52a1\u628a\u4e00\u4e2a\u6570\u636e\u5e93\u8f6c\u50a8\u4e3a directory \u683c\u5f0f\u5f52\u6863\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -Fd mydb -j 5 -f dumpdir</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u5230\u4e00\u4e2a\uff08\u65b0\u521b\u5efa\u7684\uff09\u540d\u4e3a <code class=\"literal\">newdb</code> \u7684\u6570\u636e\u5e93\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d newdb db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u628a\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u91cd\u65b0\u88c5\u5165\u751f\u6210\u8be5\u5f52\u6863\u7684\u540c\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u5e76\u4e22\u5f03\u8be5\u6570\u636e\u5e93\u7684\u5f53\u524d\u5185\u5bb9\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_restore -d postgres --clean --create db.dump</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u4e00\u4e2a\u540d\u4e3a <code class=\"literal\">mytab</code> \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t mytab mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8f6c\u50a8 detroit \u6a21\u5f0f\u4e2d\u540d\u79f0\u4ee5 emp \u5f00\u5934\u7684\u6240\u6709\u8868\uff0c\u4f46\u6392\u9664\u540d\u4e3a employee_log \u7684\u8868\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t 'detroit.emp*' -T detroit.employee_log mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u540d\u79f0\u4ee5 <code class=\"literal\">east</code> \u6216 <code class=\"literal\">west</code> \u5f00\u5934\u3001\u5e76\u4e14\u4ee5 <code class=\"literal\">gsm</code> \u7ed3\u5c3e\u7684\u6240\u6709\u6a21\u5f0f\uff0c\u540c\u65f6\u6392\u9664\u540d\u79f0\u4e2d\u5305\u542b\u5355\u8bcd <code class=\"literal\">test</code> \u7684\u4efb\u4f55\u6a21\u5f0f\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u540c\u6837\uff0c\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u6cd5\u6765\u5408\u5e76\u8fd9\u4e9b\u5f00\u5173\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -n '(east|west)*gsm' -N '*test*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u9664\u540d\u79f0\u4ee5 <code class=\"literal\">ts_</code> \u5f00\u5934\u7684\u8868\u4e4b\u5916\u7684\u6240\u6709\u6570\u636e\u5e93\u5bf9\u8c61\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -T 'ts_*' mydb &gt; db.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u5728 <code class=\"option\">-t</code> \u53ca\u76f8\u5173\u5f00\u5173\u4e2d\uff0c\u5982\u679c\u8981\u6307\u5b9a\u4e00\u4e2a\u5927\u5199\u6216\u6df7\u5408\u5927\u5c0f\u5199\u7684\u540d\u79f0\uff0c\u5c31\u9700\u8981\u5bf9\u8be5\u540d\u79f0\u52a0\u53cc\u5f15\u53f7\uff1b\u5426\u5219\u5b83\u4f1a\u88ab\u6298\u53e0\u6210\u5c0f\u5199\uff08\u89c1<a class=\"xref\" href=\"/docs/18/app-psql.html#APP-PSQL-PATTERNS\" title=\"\u6a21\u5f0f\">\u6a21\u5f0f</a>\uff09\u3002\u4f46\u53cc\u5f15\u53f7\u5bf9 shell \u6765\u8bf4\u53c8\u662f\u7279\u6b8a\u5b57\u7b26\uff0c\u56e0\u6b64\u53cd\u8fc7\u6765\u8fd8\u5fc5\u987b\u518d\u88ab\u5f15\u7528\u3002\u56e0\u6b64\uff0c\u8981\u8f6c\u50a8\u4e00\u4e2a\u5177\u6709\u6df7\u5408\u5927\u5c0f\u5199\u540d\u79f0\u7684\u5355\u4e2a\u8868\uff0c\u9700\u8981\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump -t \"\\\"MixedCaseName\\\"\" mydb &gt; mytab.sql</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u8f6c\u50a8\u6240\u6709\u540d\u79f0\u4ee5 <code class=\"literal\">mytable</code> \u5f00\u5934\u3001\u4f46\u6392\u9664 <code class=\"literal\">mytable2</code> \u8868\u7684\u8868\uff0c\u8bf7\u6307\u5b9a\u5982\u4e0b\u8fc7\u6ee4\u6587\u4ef6 <code class=\"filename\">filter.txt</code>\uff1a</p>\n<pre class=\"programlisting\">include table mytable*\nexclude table mytable2\n</pre>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_dump --filter=filter.txt mydb &gt; db.sql</code></strong>\n</pre>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.4.14.11\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><a class=\"xref\" href=\"https://pg.center/docs/18/app-pg-dumpall.html\" title=\"pg_dumpall\"><span class=\"refentrytitle\"><span class=\"application\">pg_dumpall</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/18/app-pgrestore.html\" title=\"pg_restore\"><span class=\"refentrytitle\"><span class=\"application\">pg_restore</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/18/app-psql.html\" title=\"psql\"><span class=\"refentrytitle\"><span class=\"application\">psql</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pgdump.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/app-pgdump.html", "method": "same-major semantic node", "sha256": "dfdd38193cf6167285dd5f9dddb89e2d0e3954ffb9f625f2aed61916978ad0f9", "language": "zh", "matched_nodes": ["#APP-PGDUMP/div[10]/h2[0]", "#APP-PGDUMP/div[2]/p[1]", "#APP-PGDUMP/div[3]/h2[0]", "#APP-PGDUMP/div[4]/div[7]/h3[0]", "#APP-PGDUMP/div[4]/div[7]/p[1]", "#APP-PGDUMP/div[4]/p[1]", "#APP-PGDUMP/div[4]/p[2]", "#APP-PGDUMP/div[4]/p[3]", "#APP-PGDUMP/div[4]/p[4]", "#APP-PGDUMP/div[4]/p[5]", "#APP-PGDUMP/div[4]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[101]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[103]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[105]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[107]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[109]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[111]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[113]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[115]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[117]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[119]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[121]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[123]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[125]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[125]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[127]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[129]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[131]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[133]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/h3[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[13]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[15]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[17]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/div[1]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[19]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[21]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[23]/p[0]/a[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[25]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[27]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[29]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[31]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[33]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/div[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[35]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[37]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[39]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[3]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[41]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[43]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[45]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[47]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[49]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[51]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[53]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[55]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[57]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[59]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[61]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[63]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[65]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[2]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/div[4]/ul[0]/li[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[3]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[5]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[67]/p[6]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[69]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[1]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/div[2]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[71]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[73]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[75]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[77]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[79]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[7]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[81]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[83]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[85]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[87]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[89]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[91]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[93]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[95]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[97]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[99]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[0]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dd[9]/p[1]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[4]", "#APP-PGDUMP/div[5]/div[2]/dl[0]/dt[6]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[0]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[11]/p[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[13]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[1]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[3]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[5]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[7]", "#APP-PGDUMP/div[5]/div[4]/dl[0]/dd[9]", "#APP-PGDUMP/div[5]/p[1]", "#APP-PGDUMP/div[5]/p[3]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[1]", "#APP-PGDUMP/div[6]/div[1]/dl[0]/dd[3]", "#APP-PGDUMP/div[6]/h2[0]", "#APP-PGDUMP/div[6]/p[2]", "#APP-PGDUMP/div[7]/h2[0]", "#APP-PGDUMP/div[7]/p[1]", "#APP-PGDUMP/div[7]/p[2]", "#APP-PGDUMP/div[8]/h2[0]", "#APP-PGDUMP/div[8]/p[1]", "#APP-PGDUMP/div[8]/p[3]", "#APP-PGDUMP/div[8]/p[4]", "#APP-PGDUMP/div[8]/p[5]", "#APP-PGDUMP/div[8]/p[6]", "#APP-PGDUMP/div[8]/p[7]", "#APP-PGDUMP/div[9]/p[11]", "#APP-PGDUMP/div[9]/p[13]", "#APP-PGDUMP/div[9]/p[15]", "#APP-PGDUMP/div[9]/p[19]", "#APP-PGDUMP/div[9]/p[1]", "#APP-PGDUMP/div[9]/p[21]", "#APP-PGDUMP/div[9]/p[23]", "#APP-PGDUMP/div[9]/p[25]", "#APP-PGDUMP/div[9]/p[27]", "#APP-PGDUMP/div[9]/p[3]", "#APP-PGDUMP/div[9]/p[5]", "#APP-PGDUMP/div[9]/p[7]", "#APP-PGDUMP/div[9]/p[9]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "pg_dump \u2014 export a PostgreSQL database as an SQL script or to other formats", "/versions/18/facts/0/label": "Documented executable", "/versions/18/facts/1/label": "Executable version", "/versions/18/facts/2/label": "Reference inventory", "/versions/18/facts/2/value": "Client applications", "/versions/18/facts/3/label": "Option definition groups", "/versions/18/tables/0/title": "Documented options", "/versions/18/tables/1/title": "Environment variables", "/versions/18/related/0/label": "libpq connection parameters", "/versions/18/tables/0/rows/0/summary": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped.", "/versions/18/tables/0/rows/1/summary": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is.", "/versions/18/tables/0/rows/2/summary": "Exclude large objects in the dump.", "/versions/18/tables/0/rows/3/summary": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified.", "/versions/18/tables/0/rows/4/summary": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it.", "/versions/18/tables/0/rows/5/summary": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards.", "/versions/18/tables/0/rows/6/summary": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 .", "/versions/18/tables/0/rows/7/summary": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.", "/versions/18/tables/0/rows/8/summary": "Selects the format of the output. format can be one of the following:", "/versions/18/tables/0/rows/9/summary": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time.", "/versions/18/tables/0/columns/0/label": "Option and arguments", "/versions/18/tables/0/columns/1/label": "Description", "/versions/18/tables/0/rows/10/summary": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/18/tables/0/rows/11/summary": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns.", "/versions/18/tables/0/rows/12/summary": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O .", "/versions/18/tables/0/rows/13/summary": "This option is obsolete but still accepted for backwards compatibility.", "/versions/18/tables/0/rows/14/summary": "Dump only the object definitions (schema), not data or statistics.", "/versions/18/tables/0/rows/15/summary": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)", "/versions/18/tables/0/rows/16/summary": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below.", "/versions/18/tables/0/rows/17/summary": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns.", "/versions/18/tables/0/rows/18/summary": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error.", "/versions/18/tables/0/rows/19/summary": "Print the pg_dump version and exit.", "/versions/18/tables/0/rows/20/summary": "Prevent dumping of access privileges (grant/revoke commands).", "/versions/18/tables/0/rows/21/summary": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long .", "/versions/18/tables/0/rows/22/summary": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice.", "/versions/18/tables/0/rows/23/summary": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/18/tables/0/rows/24/summary": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax.", "/versions/18/tables/0/rows/25/summary": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore.", "/versions/18/tables/0/rows/26/summary": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to.", "/versions/18/tables/0/rows/27/summary": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns.", "/versions/18/tables/0/rows/28/summary": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/18/tables/0/rows/29/summary": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it.", "/versions/18/tables/0/rows/30/summary": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/18/tables/0/rows/31/summary": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.", "/versions/18/tables/0/rows/32/summary": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files.", "/versions/18/tables/0/rows/33/summary": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.", "/versions/18/tables/0/rows/34/summary": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed.", "/versions/18/tables/0/rows/35/summary": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.", "/versions/18/tables/0/rows/36/summary": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column.", "/versions/18/tables/0/rows/37/summary": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)", "/versions/18/tables/0/rows/38/summary": "Do not dump COMMENT commands.", "/versions/18/tables/0/rows/39/summary": "Do not dump data.", "/versions/18/tables/0/rows/40/summary": "Do not dump row security policies.", "/versions/18/tables/0/rows/41/summary": "Do not dump publications.", "/versions/18/tables/0/rows/42/summary": "Do not dump schema (data definitions).", "/versions/18/tables/0/rows/43/summary": "Do not dump security labels.", "/versions/18/tables/0/rows/44/summary": "Do not dump statistics. This is the default.", "/versions/18/tables/0/rows/45/summary": "Do not dump subscriptions.", "/versions/18/tables/0/rows/46/summary": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation.", "/versions/18/tables/0/rows/47/summary": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore.", "/versions/18/tables/0/rows/48/summary": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore.", "/versions/18/tables/0/rows/49/summary": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting.", "/versions/18/tables/0/rows/50/summary": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server.", "/versions/18/tables/0/rows/51/summary": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.", "/versions/18/tables/0/rows/52/summary": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.", "/versions/18/tables/0/rows/53/summary": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters.", "/versions/18/tables/0/rows/54/summary": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.", "/versions/18/tables/0/rows/55/summary": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections.", "/versions/18/tables/0/rows/56/summary": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified.", "/versions/18/tables/0/rows/57/summary": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control.", "/versions/18/tables/0/rows/58/summary": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.100 for more details).", "/versions/18/tables/0/rows/59/summary": "Dump optimizer statistics.", "/versions/18/tables/0/rows/60/summary": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped.", "/versions/18/tables/0/rows/61/summary": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names .", "/versions/18/tables/0/rows/62/summary": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory.", "/versions/18/tables/0/rows/63/summary": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern .", "/versions/18/tables/0/rows/64/summary": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges.", "/versions/18/tables/0/rows/65/summary": "Show help about pg_dump command line arguments, and exit.", "/versions/18/tables/0/rows/66/summary": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options.", "/versions/18/tables/0/rows/67/summary": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.", "/versions/18/tables/0/rows/68/summary": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default.", "/versions/18/tables/0/rows/69/summary": "User name to connect as.", "/versions/18/tables/0/rows/70/summary": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.", "/versions/18/tables/0/rows/71/summary": "Force pg_dump to prompt for a password before connecting to a database.", "/versions/18/tables/0/rows/72/summary": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy.", "/versions/18/tables/1/columns/0/label": "Variable", "/versions/18/tables/1/columns/1/label": "Meaning", "/versions/18/tables/1/rows/0/description": "Default connection parameters.", "/versions/18/tables/1/rows/1/description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .", "/versions/18/tables/0/rows/1/signature/text": "-b --large-objects --blobs (deprecated)", "/versions/18/tables/0/rows/2/signature/text": "-B --no-large-objects --no-blobs (deprecated)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "dd59d05ee1a0f6fe95519e67ac2b7149cd761c97016d211fa2036fad8c0a41e8"}, "comparison_data": {"options": [{"names": ["-a", "--data-only"], "signature": "-a --data-only", "description": "Dump only the data, not the schema (data definitions) or statistics. Table data, large objects, and sequence values are dumped. This option is similar to, but for historical reasons not identical to, specifying --section=data ."}, {"names": ["-b", "--large-objects", "--blobs"], "signature": "-b --large-objects --blobs (deprecated)", "description": "Include large objects in the dump. This is the default behavior except when --schema , --table , --schema-only , --statistics-only , or --no-data is specified. The -b switch is therefore only useful to add large objects to dumps where a specific schema or table has been requested. Note that large objects are considered data and therefore will be included when --data-only is used, but not when --schema-only or --statistics-only is."}, {"names": ["-B", "--no-large-objects", "--no-blobs"], "signature": "-B --no-large-objects --no-blobs (deprecated)", "description": "Exclude large objects in the dump. When both -b and -B are given, the behavior is to output large objects, when data is being dumped, see the -b documentation."}, {"names": ["-c", "--clean"], "signature": "-c --clean", "description": "Output commands to DROP all the dumped database objects prior to outputting the commands for creating them. This option is useful when the restore is to overwrite an existing database. If any of the objects do not exist in the destination database, ignorable error messages will be reported during restore, unless --if-exists is also specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-C", "--create"], "signature": "-C --create", "description": "Begin the output with a command to create the database itself and reconnect to the created database. (With a script of this form, it doesn't matter which database in the destination installation you connect to before running the script.) If --clean is also specified, the script drops and recreates the target database before reconnecting to it. With --create , the output also includes the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN DATABASE ... SET ... commands that mention this database. Access privileges for the database itself are also dumped, unless --no-acl is specified. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-e pattern", "--extension= pattern"], "signature": "-e pattern --extension= pattern", "description": "Dump only extensions matching pattern . When this option is not specified, all non-system extensions in the target database will be dumped. Multiple extensions can be selected by writing multiple -e switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple extensions can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards. Any configuration relation registered by pg_extension_config_dump is included in the dump if its extension is specified by --extension . Note When -e is specified, pg_dump makes no attempt to dump any other database objects that the selected extension(s) might depend upon. Therefore, there is no guarantee that the results of a specific-extension dump can be successfully restored by themselves into a clean database."}, {"names": ["-E encoding", "--encoding= encoding"], "signature": "-E encoding --encoding= encoding", "description": "Create the dump in the specified character set encoding. By default, the dump is created in the database encoding. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) The supported encodings are described in Section 23.3.1 ."}, {"names": ["-f file", "--file= file"], "signature": "-f file --file= file", "description": "Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before."}, {"names": ["-F format", "--format= format"], "signature": "-F format --format= format", "description": "Selects the format of the output. format can be one of the following: p plain Output a plain-text SQL script file (the default). c custom Output a custom-format archive suitable for input into pg_restore . Together with the directory output format, this is the most flexible output format in that it allows manual selection and reordering of archived items during restore. This format is also compressed by default. d directory Output a directory-format archive suitable for input into pg_restore . This will create a directory with one file for each table and large object being dumped, plus a so-called Table of Contents file describing the dumped objects in a machine-readable format that pg_restore can read. A directory format archive can be manipulated with standard Unix tools; for example, files in an uncompressed archive can be compressed with the gzip , lz4 , or zstd tools. This format is compressed by default using gzip and also supports parallel dumps. t tar Output a tar -format archive suitable for input into pg_restore . The tar format is compatible with the directory format: extracting a tar-format archive produces a valid directory-format archive. However, the tar format does not support compression. Also, when using tar format the relative order of table data items cannot be changed during restore."}, {"names": ["-j njobs", "--jobs= njobs"], "signature": "-j njobs --jobs= njobs", "description": "Run the dump in parallel by dumping njobs tables simultaneously. This option may reduce the time needed to perform the dump but it also increases the load on the database server. You can only use this option with the directory output format because this is the only output format where multiple processes can write their data at the same time. pg_dump will open njobs + 1 connections to the database, so make sure your max_connections setting is high enough to accommodate all connections. Requesting exclusive locks on database objects while running a parallel dump could cause the dump to fail. The reason is that the pg_dump leader process requests shared locks ( ACCESS SHARE ) on the objects that the worker processes are going to dump later in order to make sure that nobody deletes them and makes them go away while the dump is running. If another client then requests an exclusive lock on a table, that lock will not be granted but will be queued waiting for the shared lock of the leader process to be released. Consequently any other access to the table will not be granted either and will queue after the exclusive lock request. This includes the worker process trying to dump the table. Without any precautions this would be a classic deadlock situation. To detect this conflict, the pg_dump worker process requests another shared lock using the NOWAIT option. If the worker process is not granted this shared lock, somebody else must have requested an exclusive lock in the meantime and there is no way to continue with the dump, so pg_dump has no choice but to abort the dump. To perform a parallel dump, the database server needs to support synchronized snapshots, a feature that was introduced in PostgreSQL 9.2 for primary servers and 10 for standbys. With this feature, database clients can ensure they see the same data set even though they use different connections. pg_dump -j uses multiple database connections; it connects to the database once with the leader process and once again for each worker job. Without the synchronized snapshot feature, the different worker jobs wouldn't be guaranteed to see the same data in each connection, which could lead to an inconsistent backup."}, {"names": ["-n pattern", "--schema= pattern"], "signature": "-n pattern --schema= pattern", "description": "Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as large objects are not dumped when -n is specified. You can add large objects back to the dump with the --large-objects switch."}, {"names": ["-N pattern", "--exclude-schema= pattern"], "signature": "-N pattern --exclude-schema= pattern", "description": "Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump."}, {"names": ["-O", "--no-owner"], "signature": "-O --no-owner", "description": "Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["-R", "--no-reconnect"], "signature": "-R --no-reconnect", "description": "This option is obsolete but still accepted for backwards compatibility."}, {"names": ["-s", "--schema-only"], "signature": "-s --schema-only", "description": "Dump only the object definitions (schema), not data or statistics. This option cannot be used with --data-only or --statistics-only . It is similar to, but for historical reasons not identical to, specifying --section=pre-data --section=post-data . (Do not confuse this with the --schema option, which uses the word \u201c schema \u201d in a different meaning.) To exclude table data for only a subset of tables in the database, see --exclude-table-data ."}, {"names": ["-S username", "--superuser= username"], "signature": "-S username --superuser= username", "description": "Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used. (Usually, it's better to leave this out, and instead start the resulting script as superuser.)"}, {"names": ["-t pattern", "--table= pattern"], "signature": "-t pattern --table= pattern", "description": "Dump only tables with names matching pattern . Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. As well as tables, this option can be used to dump the definition of matching views, materialized views, foreign tables, and sequences. It will not dump the contents of views or materialized views, and the contents of foreign tables will only be dumped if the corresponding foreign server is specified with --include-foreign-data . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database."}, {"names": ["-T pattern", "--exclude-table= pattern"], "signature": "-T pattern --exclude-table= pattern", "description": "Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump."}, {"names": ["-v", "--verbose"], "signature": "-v --verbose", "description": "Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error. Repeating the option causes additional debug-level messages to appear on standard error."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_dump version and exit."}, {"names": ["-x", "--no-privileges", "--no-acl"], "signature": "-x --no-privileges --no-acl", "description": "Prevent dumping of access privileges (grant/revoke commands)."}, {"names": ["-Z level", "-Z method", "--compress= level", "--compress= method"], "signature": "-Z level -Z method [: detail ] --compress= level --compress= method [: detail ]", "description": "Specify the compression method and/or the compression level to use. The compression method can be set to gzip , lz4 , zstd , or none for no compression. A compression detail string can optionally be specified. If the detail string is an integer, it specifies the compression level. Otherwise, it should be a comma-separated list of items, each of the form keyword or keyword=value . Currently, the supported keywords are level and long . If no compression level is specified, the default compression level will be used. If only a level is specified without mentioning an algorithm, gzip compression will be used if the level is greater than 0 , and no compression will be used if the level is 0 . For the custom and directory archive formats, this specifies compression of individual table-data segments, and the default is to compress using gzip at a moderate level. For plain text output, setting a nonzero compression level causes the entire output file to be compressed, as though it had been fed through gzip , lz4 , or zstd ; but the default is not to compress. With zstd compression, long mode may improve the compression ratio, at the cost of increased memory use. The tar archive format currently does not support compression at all."}, {"names": ["--binary-upgrade"], "signature": "--binary-upgrade", "description": "This option is for use by in-place upgrade utilities. Its use for other purposes is not recommended or supported. The behavior of the option may change in future releases without notice."}, {"names": ["--column-inserts", "--attribute-inserts"], "signature": "--column-inserts --attribute-inserts", "description": "Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--disable-dollar-quoting"], "signature": "--disable-dollar-quoting", "description": "This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax."}, {"names": ["--disable-triggers"], "signature": "--disable-triggers", "description": "This option is relevant only when creating a dump that includes data but does not include schema. It instructs pg_dump to include commands to temporarily disable triggers on the target tables while the data is restored. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. Presently, the commands emitted for --disable-triggers must be done as superuser. So, you should also specify a superuser name with -S , or preferably be careful to start the resulting script as a superuser. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--enable-row-security"], "signature": "--enable-row-security", "description": "This option is relevant only when dumping the contents of a table which has row security. By default, pg_dump will set row_security to off, to ensure that all data is dumped from the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_dump to set row_security to on instead, allowing the user to dump the parts of the contents of the table that they have access to. Note that if you use this option currently, you probably also want the dump be in INSERT format, as the COPY FROM during restore does not support row security."}, {"names": ["--exclude-extension= pattern"], "signature": "--exclude-extension= pattern", "description": "Do not dump any extensions matching pattern . The pattern is interpreted according to the same rules as for -e . --exclude-extension can be given more than once to exclude extensions matching any of several patterns. When both -e and --exclude-extension are given, the behavior is to dump just the extensions that match at least one -e switch but no --exclude-extension switches. If --exclude-extension appears without -e , then extensions matching --exclude-extension are excluded from what is otherwise a normal dump."}, {"names": ["--exclude-table-and-children= pattern"], "signature": "--exclude-table-and-children= pattern", "description": "This is the same as the -T / --exclude-table option, except that it also excludes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--exclude-table-data= pattern"], "signature": "--exclude-table-data= pattern", "description": "Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only or --statistics-only ."}, {"names": ["--exclude-table-data-and-children= pattern"], "signature": "--exclude-table-data-and-children= pattern", "description": "This is the same as the --exclude-table-data option, except that it also excludes data of any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--extra-float-digits= ndigits"], "signature": "--extra-float-digits= ndigits", "description": "Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option."}, {"names": ["--filter= filename"], "signature": "--filter= filename", "description": "Specify a filename from which to read patterns for objects to include or exclude from the dump. The patterns are interpreted according to the same rules as the corresponding options: -t / --table , --table-and-children , -T / --exclude-table , and --exclude-table-and-children for tables, -n / --schema and -N / --exclude-schema for schemas, --include-foreign-data for data on foreign servers, --exclude-table-data and --exclude-table-data-and-children for table data, and -e / --extension and --exclude-extension for extensions. To read from STDIN , use - as the filename. The --filter option can be specified in conjunction with the above listed options for including or excluding objects, and can also be specified more than once for multiple filter files. The file lists one object pattern per row, with the following format: { include | exclude } { extension | foreign_data | table | table_and_children | table_data | table_data_and_children | schema } PATTERN The first keyword specifies whether the objects matched by the pattern are to be included or excluded. The second keyword specifies the type of object to be filtered using the pattern: extension : extensions. This works like the -e / --extension or --exclude-extension option. foreign_data : data on foreign servers. This works like the --include-foreign-data option. This keyword can only be used with the include keyword. table : tables. This works like the -t / --table or -T / --exclude-table option. table_and_children : tables including any partitions or inheritance child tables. This works like the --table-and-children or --exclude-table-and-children option. table_data : table data of any tables matching pattern . This works like the --exclude-table-data option. This keyword can only be used with the exclude keyword. table_data_and_children : table data of any tables matching pattern as well as any partitions or inheritance children of the table(s). This works like the --exclude-table-data-and-children option. This keyword can only be used with the exclude keyword. schema : schemas. This works like the -n / --schema or -N / --exclude-schema option. Lines starting with # are considered comments and ignored. Comments can be placed after an object pattern row as well. Blank lines are also ignored. See Patterns for how to perform quoting in patterns. Example files are listed below in the Examples section."}, {"names": ["--if-exists"], "signature": "--if-exists", "description": "Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified."}, {"names": ["--include-foreign-data= foreignserver"], "signature": "--include-foreign-data= foreignserver", "description": "Dump the data for any foreign table with a foreign server matching foreignserver pattern. Multiple foreign servers can be selected by writing multiple --include-foreign-data switches. Also, the foreignserver parameter is interpreted as a pattern according to the same rules used by psql 's \\d commands (see Patterns ), so multiple foreign servers can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples below. The only exception is that an empty pattern is disallowed. Note Using wildcards in --include-foreign-data may result in access to unexpected foreign servers. Also, to use this option securely, make sure that the named server must have a trusted owner. Note When --include-foreign-data is specified, pg_dump does not check that the foreign table is writable. Therefore, there is no guarantee that the results of a foreign table dump can be successfully restored."}, {"names": ["--inserts"], "signature": "--inserts", "description": "Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower."}, {"names": ["--load-via-partition-root"], "signature": "--load-via-partition-root", "description": "When dumping data for a table partition, make the COPY or INSERT statements target the root of the partitioning hierarchy that contains it, rather than the partition itself. This causes the appropriate partition to be re-determined for each row when the data is loaded. This may be useful when restoring data on a server where rows do not always fall into the same partitions as they did on the original server. That could happen, for example, if the partitioning column is of type text and the two systems have different definitions of the collation used to sort the partitioning column."}, {"names": ["--lock-wait-timeout= timeout"], "signature": "--lock-wait-timeout= timeout", "description": "Do not wait forever to acquire shared table locks at the beginning of the dump. Instead fail if unable to lock a table within the specified timeout . The timeout may be specified in any of the formats accepted by SET statement_timeout . (Allowed formats vary depending on the server version you are dumping from, but an integer number of milliseconds is accepted by all versions.)"}, {"names": ["--no-comments"], "signature": "--no-comments", "description": "Do not dump COMMENT commands."}, {"names": ["--no-data"], "signature": "--no-data", "description": "Do not dump data."}, {"names": ["--no-policies"], "signature": "--no-policies", "description": "Do not dump row security policies."}, {"names": ["--no-publications"], "signature": "--no-publications", "description": "Do not dump publications."}, {"names": ["--no-schema"], "signature": "--no-schema", "description": "Do not dump schema (data definitions)."}, {"names": ["--no-security-labels"], "signature": "--no-security-labels", "description": "Do not dump security labels."}, {"names": ["--no-statistics"], "signature": "--no-statistics", "description": "Do not dump statistics. This is the default."}, {"names": ["--no-subscriptions"], "signature": "--no-subscriptions", "description": "Do not dump subscriptions."}, {"names": ["--no-sync"], "signature": "--no-sync", "description": "By default, pg_dump will wait for all files to be written safely to disk. This option causes pg_dump to return without waiting, which is faster, but means that a subsequent operating system crash can leave the dump corrupt. Generally, this option is useful for testing but should not be used when dumping data from production installation."}, {"names": ["--no-table-access-method"], "signature": "--no-table-access-method", "description": "Do not output commands to select table access methods. With this option, all objects will be created with whichever table access method is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-tablespaces"], "signature": "--no-tablespaces", "description": "Do not output commands to select tablespaces. With this option, all objects will be created in whichever tablespace is the default during restore. This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore ."}, {"names": ["--no-toast-compression"], "signature": "--no-toast-compression", "description": "Do not output commands to set TOAST compression methods. With this option, all columns will be restored with the default compression setting."}, {"names": ["--no-unlogged-table-data"], "signature": "--no-unlogged-table-data", "description": "Do not dump the contents of unlogged tables and sequences. This option has no effect on whether or not the table and sequence definitions (schema) are dumped; it only suppresses dumping the table and sequence data. Data in unlogged tables and sequences is always excluded when dumping from a standby server."}, {"names": ["--on-conflict-do-nothing"], "signature": "--on-conflict-do-nothing", "description": "Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified."}, {"names": ["--quote-all-identifiers"], "signature": "--quote-all-identifiers", "description": "Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script."}, {"names": ["--restrict-key= restrict_key"], "signature": "--restrict-key= restrict_key", "description": "Use the provided string as the psql \\restrict key in the dump output. This can only be specified for plain-text dumps, i.e., when --format is set to plain or the --format option is omitted. If no restrict key is specified, pg_dump will generate a random one as needed. Keys may contain only alphanumeric characters. This option is primarily intended for testing purposes and other scenarios that require repeatable output (e.g., comparing dump files). It is not recommended for general use, as a malicious server with advance knowledge of the key may be able to inject arbitrary code that will be executed on the machine that runs psql with the dump output."}, {"names": ["--rows-per-insert= nrows"], "signature": "--rows-per-insert= nrows", "description": "Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents."}, {"names": ["--section= sectionname"], "signature": "--section= sectionname", "description": "Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items."}, {"names": ["--sequence-data"], "signature": "--sequence-data", "description": "Include sequence data in the dump. This is the default behavior except when --no-data , --schema-only , or --statistics-only is specified."}, {"names": ["--serializable-deferrable"], "signature": "--serializable-deferrable", "description": "Use a serializable transaction for the dump, to ensure that the snapshot used is consistent with later database states; but do this by waiting for a point in the transaction stream at which no anomalies can be present, so that there isn't a risk of the dump failing or causing other transactions to roll back with a serialization_failure . See Chapter 13 for more information about transaction isolation and concurrency control. This option is not beneficial for a dump which is intended only for disaster recovery. It could be useful for a dump used to load a copy of the database for reporting or other read-only load sharing while the original database continues to be updated. Without it the dump may reflect a state which is not consistent with any serial execution of the transactions eventually committed. For example, if batch processing techniques are used, a batch may show as closed in the dump without all of the items which are in the batch appearing. This option will make no difference if there are no read-write transactions active when pg_dump is started. If read-write transactions are active, the start of the dump may be delayed for an indeterminate length of time. Once running, performance with or without the switch is the same."}, {"names": ["--snapshot= snapshotname"], "signature": "--snapshot= snapshotname", "description": "Use the specified synchronized snapshot when making a dump of the database (see Table 9.100 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 47 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot."}, {"names": ["--statistics"], "signature": "--statistics", "description": "Dump optimizer statistics."}, {"names": ["--statistics-only"], "signature": "--statistics-only", "description": "Dump only the statistics, not the schema (data definitions) or data. Optimizer statistics for tables, materialized views, foreign tables, and indexes are dumped."}, {"names": ["--strict-names"], "signature": "--strict-names", "description": "Require that each extension ( -e / --extension ), schema ( -n / --schema ) and table ( -t / --table ) pattern match at least one extension/schema/table in the database to be dumped. This also applies to filters used with --filter . Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without --strict-names . This option has no effect on --exclude-extension , -N / --exclude-schema , -T / --exclude-table , or --exclude-table-data . An exclude pattern failing to match any objects is not considered an error."}, {"names": ["--sync-method= method"], "signature": "--sync-method= method", "description": "When set to fsync , which is the default, pg_dump --format=directory will recursively open and synchronize all files in the archive directory. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the archive directory. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used or --format is not set to directory ."}, {"names": ["--table-and-children= pattern"], "signature": "--table-and-children= pattern", "description": "This is the same as the -t / --table option, except that it also includes any partitions or inheritance child tables of the table(s) matching the pattern ."}, {"names": ["--use-set-session-authorization"], "signature": "--use-set-session-authorization", "description": "Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly. Also, a dump using SET SESSION AUTHORIZATION will certainly require superuser privileges to restore correctly, whereas ALTER OWNER requires lesser privileges."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_dump command line arguments, and exit."}, {"names": ["-d dbname", "--dbname= dbname"], "signature": "-d dbname --dbname= dbname", "description": "Specifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line. The dbname can be a connection string . If so, connection string parameters will override any conflicting command line options."}, {"names": ["-h host", "--host= host"], "signature": "-h host --host= host", "description": "Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted."}, {"names": ["-p port", "--port= port"], "signature": "-p port --port= port", "description": "Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default."}, {"names": ["-U username", "--username= username"], "signature": "-U username --username= username", "description": "User name to connect as."}, {"names": ["-w", "--no-password"], "signature": "-w --no-password", "description": "Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password."}, {"names": ["-W", "--password"], "signature": "-W --password", "description": "Force pg_dump to prompt for a password before connecting to a database. This option is never essential, since pg_dump will automatically prompt for a password if the server demands password authentication. However, pg_dump will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt."}, {"names": ["--role= rolename"], "signature": "--role= rolename", "description": "Specifies a role name to be used to create the dump. This option causes pg_dump to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U ) lacks privileges needed by pg_dump , but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows dumps to be made without violating the policy."}], "synopsis": ["pg_dump [ connection-option ...] [ option ...] [ dbname ]"], "environment": [{"name": "PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER", "description": "Default connection parameters."}, {"name": "PG_COLOR", "description": "Specifies whether to use color in diagnostic messages. Possible values are always , auto and never ."}]}, "comparison_hash": "e4fc1961ca5ae638ffddf6b82d9336086bc97a70b652b15a5b41f476128da561", "manual_language": "zh"}, "comparison": {"left": "11", "right": "12", "status": "changed", "diff": "--- PostgreSQL 11\n+++ PostgreSQL 12\n@@ -3,6 +3,10 @@\n     {\n       \"description\": \"Default connection parameters.\",\n       \"name\": \"PGDATABASE PGHOST PGOPTIONS PGPORT PGUSER\"\n+    },\n+    {\n+      \"description\": \"Specifies whether to use color in diagnostic messages. Possible values are always , auto and never .\",\n+      \"name\": \"PG_COLOR\"\n     }\n   ],\n   \"options\": [\n@@ -79,28 +83,20 @@\n       \"signature\": \"-j njobs --jobs= njobs\"\n     },\n     {\n-      \"description\": \"Dump only schemas matching schema ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. Also, the schema parameter is interpreted as a pattern according to the same rules used by psql 's \\\\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch.\",\n-      \"names\": [\n-        \"-n schema\",\n-        \"--schema= schema\"\n-      ],\n-      \"signature\": \"-n schema --schema= schema\"\n-    },\n-    {\n-      \"description\": \"Do not dump any schemas matching the schema pattern. The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump.\",\n-      \"names\": [\n-        \"-N schema\",\n-        \"--exclude-schema= schema\"\n-      ],\n-      \"signature\": \"-N schema --exclude-schema= schema\"\n-    },\n-    {\n-      \"description\": \"Dump object identifiers ( OID s) as part of the data for every table. Use this option if your application references the OID columns in some way (e.g., in a foreign key constraint). Otherwise, this option should not be used.\",\n-      \"names\": [\n-        \"-o\",\n-        \"--oids\"\n-      ],\n-      \"signature\": \"-o --oids\"\n+      \"description\": \"Dump only schemas matching pattern ; this selects both the schema itself, and all its contained objects. When this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by writing multiple -n switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\\\d commands (see Patterns ), so multiple schemas can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . Note When -n is specified, pg_dump makes no attempt to dump any other database objects that the selected schema(s) might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be successfully restored by themselves into a clean database. Note Non-schema objects such as blobs are not dumped when -n is specified. You can add blobs back to the dump with the --blobs switch.\",\n+      \"names\": [\n+        \"-n pattern\",\n+        \"--schema= pattern\"\n+      ],\n+      \"signature\": \"-n pattern --schema= pattern\"\n+    },\n+    {\n+      \"description\": \"Do not dump any schemas matching pattern . The pattern is interpreted according to the same rules as for -n . -N can be given more than once to exclude schemas matching any of several patterns. When both -n and -N are given, the behavior is to dump just the schemas that match at least one -n switch but no -N switches. If -N appears without -n , then schemas matching -N are excluded from what is otherwise a normal dump.\",\n+      \"names\": [\n+        \"-N pattern\",\n+        \"--exclude-schema= pattern\"\n+      ],\n+      \"signature\": \"-N pattern --exclude-schema= pattern\"\n     },\n     {\n       \"description\": \"Do not output commands to set ownership of objects to match the original database. By default, pg_dump issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created database objects. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O . This option is ignored when emitting an archive (non-text) output file. For the archive formats, you can specify the option when you call pg_restore .\",\n@@ -135,20 +131,20 @@\n       \"signature\": \"-S username --superuser= username\"\n     },\n     {\n-      \"description\": \"Dump only tables with names matching table . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. Also, the table parameter is interpreted as a pattern according to the same rules used by psql 's \\\\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab .\",\n-      \"names\": [\n-        \"-t table\",\n-        \"--table= table\"\n-      ],\n-      \"signature\": \"-t table --table= table\"\n-    },\n-    {\n-      \"description\": \"Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump.\",\n-      \"names\": [\n-        \"-T table\",\n-        \"--exclude-table= table\"\n-      ],\n-      \"signature\": \"-T table --exclude-table= table\"\n+      \"description\": \"Dump only tables with names matching pattern . For this purpose, \u201c table \u201d includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. The pattern parameter is interpreted as a pattern according to the same rules used by psql 's \\\\d commands (see Patterns ), so multiple tables can also be selected by writing wildcard characters in the pattern. When using wildcards, be careful to quote the pattern if needed to prevent the shell from expanding the wildcards; see Examples . The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped. Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be successfully restored by themselves into a clean database. Note The behavior of the -t switch is not entirely upward compatible with pre-8.2 PostgreSQL versions. Formerly, writing -t tab would dump all tables named tab , but now it just dumps whichever one is visible in your default search path. To get the old behavior you can write -t '*.tab' . Also, you must write something like -t sch.tab to select a table in a particular schema, rather than the old locution of -n sch -t tab .\",\n+      \"names\": [\n+        \"-t pattern\",\n+        \"--table= pattern\"\n+      ],\n+      \"signature\": \"-t pattern --table= pattern\"\n+    },\n+    {\n+      \"description\": \"Do not dump any tables matching pattern . The pattern is interpreted according to the same rules as for -t . -T can be given more than once to exclude tables matching any of several patterns. When both -t and -T are given, the behavior is to dump just the tables that match at least one -t switch but no -T switches. If -T appears without -t , then tables matching -T are excluded from what is otherwise a normal dump.\",\n+      \"names\": [\n+        \"-T pattern\",\n+        \"--exclude-table= pattern\"\n+      ],\n+      \"signature\": \"-T pattern --exclude-table= pattern\"\n     },\n     {\n       \"description\": \"Specifies verbose mode. This will cause pg_dump to output detailed object comments and start/stop times to the dump file, and progress messages to standard error.\",\n@@ -191,7 +187,7 @@\n       \"signature\": \"--binary-upgrade\"\n     },\n     {\n-      \"description\": \"Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents.\",\n+      \"description\": \"Dump data as INSERT commands with explicit column names ( INSERT INTO table ( column , ...) VALUES ... ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.\",\n       \"names\": [\n         \"--column-inserts\",\n         \"--attribute-inserts\"\n@@ -220,11 +216,18 @@\n       \"signature\": \"--enable-row-security\"\n     },\n     {\n-      \"description\": \"Do not dump data for any tables matching the table pattern. The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only .\",\n-      \"names\": [\n-        \"--exclude-table-data= table\"\n-      ],\n-      \"signature\": \"--exclude-table-data= table\"\n+      \"description\": \"Do not dump data for any tables matching pattern . The pattern is interpreted according to the same rules as for -t . --exclude-table-data can be given more than once to exclude tables matching any of several patterns. This option is useful when you need the definition of a particular table even though you do not need the data in it. To exclude data for all tables in the database, see --schema-only .\",\n+      \"names\": [\n+        \"--exclude-table-data= pattern\"\n+      ],\n+      \"signature\": \"--exclude-table-data= pattern\"\n+    },\n+    {\n+      \"description\": \"Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. Routine dumps made for backup purposes should not use this option.\",\n+      \"names\": [\n+        \"--extra-float-digits= ndigits\"\n+      ],\n+      \"signature\": \"--extra-float-digits= ndigits\"\n     },\n     {\n       \"description\": \"Use DROP ... IF EXISTS commands to drop objects in --clean mode. This suppresses \u201c does not exist \u201d errors that might otherwise be reported. This option is not valid unless --clean is also specified.\",\n@@ -234,7 +237,7 @@\n       \"signature\": \"--if-exists\"\n     },\n     {\n-      \"description\": \"Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. However, since this option generates a separate command for each row, an error in restoring a row causes only that row to be lost rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.\",\n+      \"description\": \"Dump data as INSERT commands (rather than COPY ). This will make restoration very slow; it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents. Note that the restore might fail altogether if you have rearranged column order. The --column-inserts option is safe against column order changes, though even slower.\",\n       \"names\": [\n         \"--inserts\"\n       ],\n@@ -311,6 +314,13 @@\n       \"signature\": \"--no-unlogged-table-data\"\n     },\n     {\n+      \"description\": \"Add ON CONFLICT DO NOTHING to INSERT commands. This option is not valid unless --inserts , --column-inserts or --rows-per-insert is also specified.\",\n+      \"names\": [\n+        \"--on-conflict-do-nothing\"\n+      ],\n+      \"signature\": \"--on-conflict-do-nothing\"\n+    },\n+    {\n       \"description\": \"Force quoting of all identifiers. This option is recommended when dumping a database from a server whose PostgreSQL major version is different from pg_dump 's, or when the output is intended to be loaded into a server of a different major version. By default, pg_dump quotes only identifiers that are reserved words in its own major version. This sometimes results in compatibility issues when dealing with servers of other versions that may have slightly different sets of reserved words. Using --quote-all-identifiers prevents such issues, at the price of a harder-to-read dump script.\",\n       \"names\": [\n         \"--quote-all-identifiers\"\n@@ -318,6 +328,13 @@\n       \"signature\": \"--quote-all-identifiers\"\n     },\n     {\n+      \"description\": \"Dump data as INSERT commands (rather than COPY ). Controls the maximum number of rows per INSERT command. The value specified must be a number greater than zero. Any error during restoring will cause only rows that are part of the problematic INSERT to be lost, rather than the entire table contents.\",\n+      \"names\": [\n+        \"--rows-per-insert= nrows\"\n+      ],\n+      \"signature\": \"--rows-per-insert= nrows\"\n+    },\n+    {\n       \"description\": \"Only dump the named section. The section name can be pre-data , data , or post-data . This option can be specified more than once to select multiple sections. The default is to dump all sections. The data section contains actual table data, large-object contents, and sequence values. Post-data items include definitions of indexes, triggers, rules, and constraints other than validated check constraints. Pre-data items include all other data definition items.\",\n       \"names\": [\n         \"--section= sectionname\"\n@@ -332,7 +349,7 @@\n       \"signature\": \"--serializable-deferrable\"\n     },\n     {\n-      \"description\": \"Use the specified synchronized snapshot when making a dump of the database (see Table 9.82 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 49 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot.\",\n+      \"description\": \"Use the specified synchronized snapshot when making a dump of the database (see Table 9.87 for more details). This option is useful when needing to synchronize the dump with a logical replication slot (see Chapter 48 ) or with a concurrent session. In the case of a parallel dump, the snapshot name defined by this option is used rather than taking a new snapshot.\",\n       \"names\": [\n         \"--snapshot= snapshotname\"\n       ],"}}