{"kind": "tool", "major": "18", "item": {"slug": "postgres", "name": "postgres", "name_zh": "", "category": "\u670d\u52a1\u7aef\u7a0b\u5e8f", "summary": "postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668", "aliases": ["postgres"], "content_hash": "dff260ed48f8cf35474ef327a06d14a08309c3a53527c7d002cd363884cad3b6", "versions": {"10": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "10.23"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "32"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/10/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u5728 extra-options \u4e2d\u6307\u5b9a\u7684\u547d\u4ee4\u884c\u5f62\u5f0f\u53c2\u6570\uff0c\u4f1a\u4f20\u7ed9\u7531\u8fd9\u4e2a postgres \u8fdb\u7a0b\u542f\u52a8\u7684\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-o extra-options"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u5185\u90e8\u6392\u5e8f\u548c hash \u8fd0\u7b97\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u5185\u5b58\u91cf\u3002\u6709\u5173 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-n"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u901a\u8fc7\u53d1\u9001 SIGSTOP \u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/10/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/10/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/10/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/10/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/10/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/10/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/10/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/10/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/10/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/10/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/10/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/10/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/10/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-o extra-options"], "summary": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process.", "signature": "-o extra-options", "source_url": "/docs/10/app-postgres.html", "description": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process. Spaces within extra-options are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. Multiple arguments can also be specified via multiple uses of -o . The use of this option is obsolete; all command-line options for server processes can be specified directly on the postgres command line."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/10/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/10/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/10/app-postgres.html", "description": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/10/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/10/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/10/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/10/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/10/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "signature": "-n", "source_url": "/docs/10/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/10/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/10/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/10/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "signature": "-T", "source_url": "/docs/10/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/10/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/10/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/10/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/10/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/10/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/10/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "10.23 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "52f7c812383968e0f5dbf013ff5c9147549ad7ec7629e5b8459d08727ed63db8", "language": "en", "original_url": "/docs/10/app-postgres.html"}, {"url": "https://pg.center/docs/10/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "2a6043b88501763a31348758a370a42cd7f9a179c7fdf3ef0e353c82e95b33e9", "language": "en", "original_url": "/docs/10/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.13.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.13.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/10/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/10/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/10/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/10/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.13.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/10/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/10/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/10/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"xref\" href=\"/docs/10/sql-show.html\" title=\"SHOW\"><span class=\"refentrytitle\">SHOW</span></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/10/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/10/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/10/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/10/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/10/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/10/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/10/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>extra-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728<em class=\"replaceable\"><code>extra-options</code></em>\u4e2d\u6307\u5b9a\u7684\u547d\u4ee4\u884c\u5f62\u5f0f\u53c2\u6570\uff0c\u4f1a\u4f20\u7ed9\u7531\u8fd9\u4e2a<code class=\"command\">postgres</code>\u8fdb\u7a0b\u542f\u52a8\u7684\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u3002</p>\n<p lang=\"zh\"><em class=\"replaceable\"><code>extra-options</code></em>\u4e2d\u7684\u7a7a\u683c\u88ab\u89c6\u4e3a\u53c2\u6570\u5206\u9694\u7b26\uff0c\u9664\u975e\u7528\u53cd\u659c\u7ebf\uff08<code class=\"literal\">\\</code>\uff09\u8f6c\u4e49\uff1b\u5199\u6210<code class=\"literal\">\\\\</code>\u53ef\u8868\u793a\u5b57\u9762\u7684\u53cd\u659c\u7ebf\u3002\u4e5f\u53ef\u4ee5\u591a\u6b21\u4f7f\u7528<code class=\"option\">-o</code>\u6765\u6307\u5b9a\u591a\u4e2a\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5df2\u8fc7\u65f6\uff1b\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6240\u6709\u547d\u4ee4\u884c\u9009\u9879\u90fd\u53ef\u4ee5\u76f4\u63a5\u5728<code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5185\u90e8\u6392\u5e8f\u548c hash \u8fd0\u7b97\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u5185\u5b58\u91cf\u3002\u6709\u5173<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/10/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.13.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u901a\u8fc7\u53d1\u9001<code class=\"literal\">SIGSTOP</code>\u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.13.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/10/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">\u5355\u7528\u6237\u6a21\u5f0f</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.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\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/10/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.13.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/10/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/10/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/10/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.13.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/10/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/10/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.26.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.26.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.13.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/10/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>, <a class=\"xref\" href=\"https://pg.center/docs/10/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/10/app-postgres.html", "method": "same-major semantic node", "sha256": "4e62ac43c488f36c0cc6ce115a2d92e6197ccca1468ad36d77ddb28e6df02699", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[39]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/div[4]/p[2]/a[0]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/10/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/10/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/10/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/10/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/10/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/10/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/10/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/10/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/10/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/10/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/10/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/10/tables/0/rows/12/summary": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process.", "/versions/10/tables/0/rows/13/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/10/tables/0/rows/14/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/10/tables/0/rows/15/summary": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/10/tables/0/rows/16/summary": "Print the postgres version and exit.", "/versions/10/tables/0/rows/17/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/10/tables/0/rows/18/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/10/tables/0/rows/19/summary": "Show help about postgres command line arguments, and exit.", "/versions/10/tables/0/rows/20/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/10/tables/0/rows/21/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "/versions/10/tables/0/rows/22/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/10/tables/0/rows/23/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/10/tables/0/rows/24/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/10/tables/0/rows/25/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "/versions/10/tables/0/rows/26/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/10/tables/0/rows/27/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/10/tables/0/rows/28/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/10/tables/0/rows/29/summary": "Echo all commands to standard output before executing them.", "/versions/10/tables/0/rows/30/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/10/tables/0/rows/31/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/10/tables/1/columns/0/label": "Variable", "/versions/10/tables/1/columns/1/label": "Meaning", "/versions/10/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/10/tables/1/rows/1/description": "Default data directory location", "/versions/10/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/10/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "6f447612fa352417830337a0caf88ecac6b667a51fdb7c8be254aea739182c08"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-o extra-options"], "signature": "-o extra-options", "description": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process. Spaces within extra-options are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. Multiple arguments can also be specified via multiple uses of -o . The use of this option is obsolete; all command-line options for server processes can be specified directly on the postgres command line."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "signature": "-n", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "3f9fe5a56efa05940e6a6abd7bb3e35145892a71a3aee5bf644404c057623f19", "manual_language": "zh"}, "11": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "11.22"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "32"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/11/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u5728 extra-options \u4e2d\u6307\u5b9a\u7684\u547d\u4ee4\u884c\u5f62\u5f0f\u53c2\u6570\uff0c\u4f1a\u4f20\u7ed9\u7531\u8fd9\u4e2a postgres \u8fdb\u7a0b\u542f\u52a8\u7684\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-o extra-options"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u5185\u90e8\u6392\u5e8f\u548c hash \u8fd0\u7b97\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u5185\u5b58\u91cf\u3002\u6709\u5173 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-n"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u901a\u8fc7\u53d1\u9001 SIGSTOP \u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/11/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/11/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/11/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/11/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/11/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/11/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/11/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/11/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/11/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/11/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/11/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/11/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/11/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-o extra-options"], "summary": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process.", "signature": "-o extra-options", "source_url": "/docs/11/app-postgres.html", "description": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process. Spaces within extra-options are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. Multiple arguments can also be specified via multiple uses of -o . The use of this option is obsolete; all command-line options for server processes can be specified directly on the postgres command line."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/11/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/11/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/11/app-postgres.html", "description": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/11/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/11/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/11/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/11/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/11/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "signature": "-n", "source_url": "/docs/11/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/11/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/11/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/11/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "signature": "-T", "source_url": "/docs/11/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/11/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/11/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/11/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/11/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/11/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/11/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "11.22 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "1ccda51949970ae81ca1663118a9b14be0817574e74a61a2f8a005f328cec17e", "language": "en", "original_url": "/docs/11/app-postgres.html"}, {"url": "https://pg.center/docs/11/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "e940a8505b6742c717a1683d19bf8f759aad245633a59db9e83a345ae7c5709a", "language": "en", "original_url": "/docs/11/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.14.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/11/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/11/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/11/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/11/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/11/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/11/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/11/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"xref\" href=\"/docs/11/sql-show.html\" title=\"SHOW\"><span class=\"refentrytitle\">SHOW</span></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/11/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/11/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/11/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/11/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/11/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/11/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/11/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>extra-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728<em class=\"replaceable\"><code>extra-options</code></em>\u4e2d\u6307\u5b9a\u7684\u547d\u4ee4\u884c\u5f62\u5f0f\u53c2\u6570\uff0c\u4f1a\u4f20\u7ed9\u7531\u8fd9\u4e2a<code class=\"command\">postgres</code>\u8fdb\u7a0b\u542f\u52a8\u7684\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u3002</p>\n<p lang=\"zh\"><em class=\"replaceable\"><code>extra-options</code></em>\u4e2d\u7684\u7a7a\u683c\u88ab\u89c6\u4e3a\u53c2\u6570\u5206\u9694\u7b26\uff0c\u9664\u975e\u7528\u53cd\u659c\u7ebf\uff08<code class=\"literal\">\\</code>\uff09\u8f6c\u4e49\uff1b\u5199\u6210<code class=\"literal\">\\\\</code>\u53ef\u8868\u793a\u5b57\u9762\u7684\u53cd\u659c\u7ebf\u3002\u4e5f\u53ef\u4ee5\u591a\u6b21\u4f7f\u7528<code class=\"option\">-o</code>\u6765\u6307\u5b9a\u591a\u4e2a\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5df2\u8fc7\u65f6\uff1b\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6240\u6709\u547d\u4ee4\u884c\u9009\u9879\u90fd\u53ef\u4ee5\u76f4\u63a5\u5728<code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5185\u90e8\u6392\u5e8f\u548c hash \u8fd0\u7b97\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u5185\u5b58\u91cf\u3002\u6709\u5173<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/11/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u901a\u8fc7\u53d1\u9001<code class=\"literal\">SIGSTOP</code>\u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/11/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">\u5355\u7528\u6237\u6a21\u5f0f</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.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\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/11/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/11/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/11/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/11/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/11/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/11/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.26.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.26.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/11/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>, <a class=\"xref\" href=\"https://pg.center/docs/11/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/11/app-postgres.html", "method": "same-major semantic node", "sha256": "c9912209711c6b837a37524aee3a15cad3145230c0e1e8a642f2895402681758", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[39]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/div[4]/p[2]/a[0]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/11/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/11/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/11/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/11/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/11/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/11/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/11/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/11/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/11/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/11/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/11/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/11/tables/0/rows/12/summary": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process.", "/versions/11/tables/0/rows/13/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/11/tables/0/rows/14/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/11/tables/0/rows/15/summary": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/11/tables/0/rows/16/summary": "Print the postgres version and exit.", "/versions/11/tables/0/rows/17/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/11/tables/0/rows/18/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/11/tables/0/rows/19/summary": "Show help about postgres command line arguments, and exit.", "/versions/11/tables/0/rows/20/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/11/tables/0/rows/21/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "/versions/11/tables/0/rows/22/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/11/tables/0/rows/23/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/11/tables/0/rows/24/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/11/tables/0/rows/25/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "/versions/11/tables/0/rows/26/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/11/tables/0/rows/27/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/11/tables/0/rows/28/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/11/tables/0/rows/29/summary": "Echo all commands to standard output before executing them.", "/versions/11/tables/0/rows/30/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/11/tables/0/rows/31/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/11/tables/1/columns/0/label": "Variable", "/versions/11/tables/1/columns/1/label": "Meaning", "/versions/11/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/11/tables/1/rows/1/description": "Default data directory location", "/versions/11/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/11/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "3baa617ba4e69b832c8a977e8d9d9586ba3e74f54eb31008df0bdf5fb4537a59"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-o extra-options"], "signature": "-o extra-options", "description": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process. Spaces within extra-options are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. Multiple arguments can also be specified via multiple uses of -o . The use of this option is obsolete; all command-line options for server processes can be specified directly on the postgres command line."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "signature": "-n", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "3f9fe5a56efa05940e6a6abd7bb3e35145892a71a3aee5bf644404c057623f19", "manual_language": "zh"}, "12": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "12.22"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "32"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/12/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u5728 extra-options \u4e2d\u6307\u5b9a\u7684\u547d\u4ee4\u884c\u5f62\u5f0f\u53c2\u6570\uff0c\u4f1a\u4f20\u7ed9\u7531\u8fd9\u4e2a postgres \u8fdb\u7a0b\u542f\u52a8\u7684\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-o extra-options"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u5185\u90e8\u6392\u5e8f\u548c hash \u8fd0\u7b97\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u5185\u5b58\u91cf\u3002\u6709\u5173 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-n"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u901a\u8fc7\u53d1\u9001 SIGSTOP \u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/12/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/12/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/12/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/12/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/12/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/12/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/12/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/12/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/12/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/12/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/12/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/12/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/12/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-o extra-options"], "summary": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process.", "signature": "-o extra-options", "source_url": "/docs/12/app-postgres.html", "description": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process. Spaces within extra-options are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. Multiple arguments can also be specified via multiple uses of -o . The use of this option is obsolete; all command-line options for server processes can be specified directly on the postgres command line."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/12/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/12/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/12/app-postgres.html", "description": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/12/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/12/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/12/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/12/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/12/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "signature": "-n", "source_url": "/docs/12/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/12/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/12/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/12/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "signature": "-T", "source_url": "/docs/12/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/12/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/12/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/12/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/12/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/12/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/12/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "12.22 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "7579f6b7878d03f355e80150b6b06eaf243e459f012ca39c3f2d55a26116c470", "language": "en", "original_url": "/docs/12/app-postgres.html"}, {"url": "https://pg.center/docs/12/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "7f6ae1fadc1b0bffa606551460e62aacdc2508a3fb66566ddae861928ca6080b", "language": "en", "original_url": "/docs/12/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.14.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/12/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/12/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/12/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/12/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/12/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/12/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/12/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"xref\" href=\"/docs/12/sql-show.html\" title=\"SHOW\"><span class=\"refentrytitle\">SHOW</span></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/12/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/12/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/12/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/12/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/12/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/12/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/12/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>extra-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728<em class=\"replaceable\"><code>extra-options</code></em>\u4e2d\u6307\u5b9a\u7684\u547d\u4ee4\u884c\u5f62\u5f0f\u53c2\u6570\uff0c\u4f1a\u4f20\u7ed9\u7531\u8fd9\u4e2a<code class=\"command\">postgres</code>\u8fdb\u7a0b\u542f\u52a8\u7684\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u3002</p>\n<p lang=\"zh\"><em class=\"replaceable\"><code>extra-options</code></em>\u4e2d\u7684\u7a7a\u683c\u88ab\u89c6\u4e3a\u53c2\u6570\u5206\u9694\u7b26\uff0c\u9664\u975e\u7528\u53cd\u659c\u7ebf\uff08<code class=\"literal\">\\</code>\uff09\u8f6c\u4e49\uff1b\u5199\u6210<code class=\"literal\">\\\\</code>\u53ef\u8868\u793a\u5b57\u9762\u7684\u53cd\u659c\u7ebf\u3002\u4e5f\u53ef\u4ee5\u591a\u6b21\u4f7f\u7528<code class=\"option\">-o</code>\u6765\u6307\u5b9a\u591a\u4e2a\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5df2\u8fc7\u65f6\uff1b\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6240\u6709\u547d\u4ee4\u884c\u9009\u9879\u90fd\u53ef\u4ee5\u76f4\u63a5\u5728<code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5185\u90e8\u6392\u5e8f\u548c hash \u8fd0\u7b97\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u5185\u5b58\u91cf\u3002\u6709\u5173<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/12/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u901a\u8fc7\u53d1\u9001<code class=\"literal\">SIGSTOP</code>\u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/12/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">\u5355\u7528\u6237\u6a21\u5f0f</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.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\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/12/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/12/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/12/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/12/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/12/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/12/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.26.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.26.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/12/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>, <a class=\"xref\" href=\"https://pg.center/docs/12/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/12/app-postgres.html", "method": "same-major semantic node", "sha256": "1057a1dba1e1cc70c62f6b6053af93d88416b4526518d4fdf1cf3c836a578584", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[39]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/div[4]/p[2]/a[0]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/12/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/12/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/12/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/12/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/12/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/12/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/12/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/12/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/12/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/12/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/12/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/12/tables/0/rows/12/summary": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process.", "/versions/12/tables/0/rows/13/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/12/tables/0/rows/14/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/12/tables/0/rows/15/summary": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/12/tables/0/rows/16/summary": "Print the postgres version and exit.", "/versions/12/tables/0/rows/17/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/12/tables/0/rows/18/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/12/tables/0/rows/19/summary": "Show help about postgres command line arguments, and exit.", "/versions/12/tables/0/rows/20/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/12/tables/0/rows/21/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "/versions/12/tables/0/rows/22/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/12/tables/0/rows/23/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/12/tables/0/rows/24/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/12/tables/0/rows/25/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "/versions/12/tables/0/rows/26/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/12/tables/0/rows/27/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/12/tables/0/rows/28/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/12/tables/0/rows/29/summary": "Echo all commands to standard output before executing them.", "/versions/12/tables/0/rows/30/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/12/tables/0/rows/31/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/12/tables/1/columns/0/label": "Variable", "/versions/12/tables/1/columns/1/label": "Meaning", "/versions/12/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/12/tables/1/rows/1/description": "Default data directory location", "/versions/12/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/12/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "0a9cca105b319e6694d0c8d5adb59e5967d76f99460cfb02889f11d48252825d"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-o extra-options"], "signature": "-o extra-options", "description": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process. Spaces within extra-options are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. Multiple arguments can also be specified via multiple uses of -o . The use of this option is obsolete; all command-line options for server processes can be specified directly on the postgres command line."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "signature": "-n", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "3f9fe5a56efa05940e6a6abd7bb3e35145892a71a3aee5bf644404c057623f19", "manual_language": "zh"}, "13": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "13.23"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "32"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/13/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u5728 extra-options \u4e2d\u6307\u5b9a\u7684\u547d\u4ee4\u884c\u5f62\u5f0f\u53c2\u6570\uff0c\u4f1a\u4f20\u7ed9\u7531\u8fd9\u4e2a postgres \u8fdb\u7a0b\u542f\u52a8\u7684\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-o extra-options"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-n"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u901a\u8fc7\u53d1\u9001 SIGSTOP \u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/13/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/13/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/13/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/13/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/13/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/13/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/13/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/13/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/13/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/13/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/13/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/13/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/13/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-o extra-options"], "summary": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process.", "signature": "-o extra-options", "source_url": "/docs/13/app-postgres.html", "description": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process. Spaces within extra-options are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. Multiple arguments can also be specified via multiple uses of -o . The use of this option is obsolete; all command-line options for server processes can be specified directly on the postgres command line."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/13/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/13/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/13/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/13/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/13/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/13/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/13/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/13/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "signature": "-n", "source_url": "/docs/13/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/13/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/13/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/13/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "signature": "-T", "source_url": "/docs/13/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/13/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/13/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/13/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/13/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/13/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/13/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "13.23 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "85f28d496b7387bfbe33b2175152056da3d724fb0759a8791f3fce05440e9ef1", "language": "en", "original_url": "/docs/13/app-postgres.html"}, {"url": "https://pg.center/docs/13/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "074ef8577fd368272a2360309e1226e2d0b1e570a3e1da62dfcca63ac9ee5539", "language": "en", "original_url": "/docs/13/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.14.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/13/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/13/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/13/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/13/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/13/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/13/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/13/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"xref\" href=\"/docs/13/sql-show.html\" title=\"SHOW\"><span class=\"refentrytitle\">SHOW</span></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/13/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/13/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/13/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/13/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/13/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/13/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/13/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>extra-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u5728<em class=\"replaceable\"><code>extra-options</code></em>\u4e2d\u6307\u5b9a\u7684\u547d\u4ee4\u884c\u5f62\u5f0f\u53c2\u6570\uff0c\u4f1a\u4f20\u7ed9\u7531\u8fd9\u4e2a<code class=\"command\">postgres</code>\u8fdb\u7a0b\u542f\u52a8\u7684\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u3002</p>\n<p lang=\"zh\"><em class=\"replaceable\"><code>extra-options</code></em>\u4e2d\u7684\u7a7a\u683c\u88ab\u89c6\u4e3a\u53c2\u6570\u5206\u9694\u7b26\uff0c\u9664\u975e\u7528\u53cd\u659c\u7ebf\uff08<code class=\"literal\">\\</code>\uff09\u8f6c\u4e49\uff1b\u5199\u6210<code class=\"literal\">\\\\</code>\u53ef\u8868\u793a\u5b57\u9762\u7684\u53cd\u659c\u7ebf\u3002\u4e5f\u53ef\u4ee5\u591a\u6b21\u4f7f\u7528<code class=\"option\">-o</code>\u6765\u6307\u5b9a\u591a\u4e2a\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u6b64\u9009\u9879\u5df2\u8fc7\u65f6\uff1b\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6240\u6709\u547d\u4ee4\u884c\u9009\u9879\u90fd\u53ef\u4ee5\u76f4\u63a5\u5728<code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u4e0a\u6307\u5b9a\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/13/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u901a\u8fc7\u53d1\u9001<code class=\"literal\">SIGSTOP</code>\u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/13/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.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\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/13/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/13/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/13/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/13/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/13/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/13/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.27.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.27.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/13/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>, <a class=\"xref\" href=\"https://pg.center/docs/13/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/13/app-postgres.html", "method": "same-major semantic node", "sha256": "ac11a13327a6cabfd83e264fe97c800f2bffd301e2e3f09a1f07e7558f960d94", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[39]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/13/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/13/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/13/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/13/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/13/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/13/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/13/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/13/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/13/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/13/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/13/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/13/tables/0/rows/12/summary": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process.", "/versions/13/tables/0/rows/13/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/13/tables/0/rows/14/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/13/tables/0/rows/15/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/13/tables/0/rows/16/summary": "Print the postgres version and exit.", "/versions/13/tables/0/rows/17/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/13/tables/0/rows/18/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/13/tables/0/rows/19/summary": "Show help about postgres command line arguments, and exit.", "/versions/13/tables/0/rows/20/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/13/tables/0/rows/21/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "/versions/13/tables/0/rows/22/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/13/tables/0/rows/23/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/13/tables/0/rows/24/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/13/tables/0/rows/25/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "/versions/13/tables/0/rows/26/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/13/tables/0/rows/27/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/13/tables/0/rows/28/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/13/tables/0/rows/29/summary": "Echo all commands to standard output before executing them.", "/versions/13/tables/0/rows/30/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/13/tables/0/rows/31/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/13/tables/1/columns/0/label": "Variable", "/versions/13/tables/1/columns/1/label": "Meaning", "/versions/13/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/13/tables/1/rows/1/description": "Default data directory location", "/versions/13/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/13/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "8dfdf1619cb58823799b2d36ae60c88f70f1bf267355c7793bc312f15a749ed3"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-o extra-options"], "signature": "-o extra-options", "description": "The command-line-style arguments specified in extra-options are passed to all server processes started by this postgres process. Spaces within extra-options are considered to separate arguments, unless escaped with a backslash ( \\ ); write \\\\ to represent a literal backslash. Multiple arguments can also be specified via multiple uses of -o . The use of this option is obsolete; all command-line options for server processes can be specified directly on the postgres command line."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "signature": "-n", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "96c72a7979b6f4157d1795e5e965e96ce25c49dbc6159d60560f3e4cc7795df2", "manual_language": "zh"}, "14": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "14.24"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "31"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 20 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 20.2 \u8282 \u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/14/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 19.9 \u8282 \u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 20.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-n"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u901a\u8fc7\u53d1\u9001 SIGSTOP \u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/14/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/14/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/14/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/14/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/14/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 20.2 for details.", "signature": "-D datadir", "source_url": "/docs/14/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 20.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/14/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/14/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/14/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/14/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/14/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 .", "signature": "-l", "source_url": "/docs/14/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/14/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/14/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/14/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 .", "signature": "-S work-mem", "source_url": "/docs/14/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/14/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/14/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/14/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/14/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/14/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "signature": "-n", "source_url": "/docs/14/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/14/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/14/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/14/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "signature": "-T", "source_url": "/docs/14/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/14/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/14/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/14/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/14/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/14/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/14/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "14.24 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "cf10f1dd60f6071eea8cda67827185d2ebade66feea7196ebb78a7ec8c9af486", "language": "en", "original_url": "/docs/14/app-postgres.html"}, {"url": "https://pg.center/docs/14/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "db0cdccaa8d3c65ad3b2a07d4956eb5a783a18505bfa0f9d9626eef4ab94fe44", "language": "en", "original_url": "/docs/14/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.14.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/14/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/14/runtime-config-file-locations.html\" title=\"20.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a020.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/14/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/14/runtime-config.html\" title=\"\u7b2c\u00a020\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a020\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/14/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/14/runtime-config.html\" title=\"\u7b2c\u00a020\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a020\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4e2a\u9009\u9879\u53ef\u7528\u4e8e\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\uff0c\u5b83\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/14/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"link\" href=\"/docs/14/sql-show.html\" title=\"SHOW\"><code class=\"command\">SHOW</code></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/14/runtime-config-file-locations.html\" title=\"20.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a020.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/14/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/14/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/14/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/14/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/14/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 19.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/14/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/14/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"20.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a020.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u901a\u8fc7\u53d1\u9001<code class=\"literal\">SIGSTOP</code>\u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/14/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.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\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/14/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/14/kernel-resources.html\" title=\"19.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a019.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/14/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/14/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/14/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/14/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.27.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.27.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/14/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/14/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/14/app-postgres.html", "method": "same-major semantic node", "sha256": "2202e6390f94b5cd0dcd1e57f327a2d27fca0d3ec186dbab886e5c1dae0183da", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/14/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/14/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/14/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/14/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/14/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 20.2 for details.", "/versions/14/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/14/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/14/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/14/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/14/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 .", "/versions/14/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/14/tables/0/rows/12/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/14/tables/0/rows/13/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/14/tables/0/rows/14/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 .", "/versions/14/tables/0/rows/15/summary": "Print the postgres version and exit.", "/versions/14/tables/0/rows/16/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/14/tables/0/rows/17/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/14/tables/0/rows/18/summary": "Show help about postgres command line arguments, and exit.", "/versions/14/tables/0/rows/19/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/14/tables/0/rows/20/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "/versions/14/tables/0/rows/21/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/14/tables/0/rows/22/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/14/tables/0/rows/23/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/14/tables/0/rows/24/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "/versions/14/tables/0/rows/25/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/14/tables/0/rows/26/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/14/tables/0/rows/27/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/14/tables/0/rows/28/summary": "Echo all commands to standard output before executing them.", "/versions/14/tables/0/rows/29/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/14/tables/0/rows/30/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/14/tables/1/columns/0/label": "Variable", "/versions/14/tables/1/columns/1/label": "Meaning", "/versions/14/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/14/tables/1/rows/1/description": "Default data directory location", "/versions/14/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/14/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "01e734bfc543aae39402dd79f7d5b00ac05ea2da030640b0b34f28df005529ab"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This can be used on a running server, and returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 20.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "signature": "-n", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "2bea9608e2adad25948ad3ac67c4de2341ed993bb055ebe07f55cea2aa6334b3", "manual_language": "zh"}, "15": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "15.19"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "31"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 20 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 20.2 \u8282 \u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/15/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 19.9 \u8282 \u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 20.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-n"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a postgres \u901a\u8fc7\u53d1\u9001 SIGSTOP \u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/15/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/15/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/15/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/15/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/15/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 20.2 for details.", "signature": "-D datadir", "source_url": "/docs/15/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 20.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/15/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/15/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/15/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/15/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/15/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 .", "signature": "-l", "source_url": "/docs/15/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/15/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/15/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/15/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 .", "signature": "-S work-mem", "source_url": "/docs/15/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/15/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/15/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/15/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/15/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/15/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "signature": "-n", "source_url": "/docs/15/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/15/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/15/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/15/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "signature": "-T", "source_url": "/docs/15/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/15/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/15/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/15/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/15/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/15/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/15/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "15.19 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "3d1f8ca1aa3e94e879afb2b382dd7f4e9d04c28e29f16208775c0b4d96a79eff", "language": "en", "original_url": "/docs/15/app-postgres.html"}, {"url": "https://pg.center/docs/15/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "1240cfbb13ebfd22aac8d5ae40c62a9015b246f7774bcf0bce97355ce06350a0", "language": "en", "original_url": "/docs/15/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.14.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/15/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/15/runtime-config-file-locations.html\" title=\"20.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a020.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/15/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/15/runtime-config.html\" title=\"\u7b2c\u00a020\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a020\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/15/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/15/runtime-config.html\" title=\"\u7b2c\u00a020\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a020\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u5927\u591a\u6570\u53c2\u6570\uff0c\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u5728\u8fd0\u884c\u4e2d\u7684\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5728\u8fd0\u884c\u65f6\u8ba1\u7b97\u51fa\u7684\u53c2\u6570\uff0c\u670d\u52a1\u5668\u5fc5\u987b\u5148\u5173\u95ed\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/15/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\">shared_memory_size</a>\u3001<a class=\"xref\" href=\"/docs/15/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\">shared_memory_size_in_huge_pages</a>\u548c<a class=\"xref\" href=\"/docs/15/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\">wal_segment_size</a>\uff09\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/15/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"link\" href=\"/docs/15/sql-show.html\" title=\"SHOW\"><code class=\"command\">SHOW</code></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/15/runtime-config-file-locations.html\" title=\"20.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a020.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/15/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/15/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/15/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/15/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/15/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 19.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/15/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/15/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"20.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a020.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-n</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u4e0d\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u6570\u636e\u7ed3\u6784\u3002\u7ecf\u9a8c\u4e30\u5bcc\u7684\u7cfb\u7edf\u7a0b\u5e8f\u5458\u968f\u540e\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5668\u68c0\u67e5\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u7684\u72b6\u6001\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6b64\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u77e5\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u5fc5\u987b\u7ec8\u6b62\uff0c\u7136\u540e\u91cd\u65b0\u521d\u59cb\u5316\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u8fd9\u662f\u56e0\u4e3a\u51fa\u9519\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u53ef\u80fd\u5728\u7ec8\u6b62\u524d\u7834\u574f\u4e86\u67d0\u4e9b\u5171\u4eab\u72b6\u6001\u3002\u6b64\u9009\u9879\u6307\u5b9a<code class=\"command\">postgres</code>\u901a\u8fc7\u53d1\u9001<code class=\"literal\">SIGSTOP</code>\u4fe1\u53f7\u6682\u505c\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u4f46\u4e0d\u4f7f\u5b83\u4eec\u7ec8\u6b62\u3002\u8fd9\u5141\u8bb8\u7cfb\u7edf\u7a0b\u5e8f\u5458\u624b\u5de5\u6536\u96c6\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\u7684\u6838\u5fc3\u8f6c\u50a8\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/15/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.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\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/15/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/15/kernel-resources.html\" title=\"19.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a019.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/15/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/15/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/15/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/15/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.27.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.27.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/15/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/15/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/15/app-postgres.html", "method": "same-major semantic node", "sha256": "52013c1f38fd99de4e521d400d750ec4cf3c734365c50b58041d8cdd2077d541", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/15/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/15/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/15/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/15/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/15/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 20.2 for details.", "/versions/15/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/15/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/15/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/15/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/15/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 .", "/versions/15/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/15/tables/0/rows/12/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/15/tables/0/rows/13/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/15/tables/0/rows/14/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 .", "/versions/15/tables/0/rows/15/summary": "Print the postgres version and exit.", "/versions/15/tables/0/rows/16/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/15/tables/0/rows/17/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/15/tables/0/rows/18/summary": "Show help about postgres command line arguments, and exit.", "/versions/15/tables/0/rows/19/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/15/tables/0/rows/20/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state.", "/versions/15/tables/0/rows/21/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/15/tables/0/rows/22/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/15/tables/0/rows/23/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/15/tables/0/rows/24/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand.", "/versions/15/tables/0/rows/25/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/15/tables/0/rows/26/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/15/tables/0/rows/27/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/15/tables/0/rows/28/summary": "Echo all commands to standard output before executing them.", "/versions/15/tables/0/rows/29/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/15/tables/0/rows/30/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/15/tables/1/columns/0/label": "Variable", "/versions/15/tables/1/columns/1/label": "Meaning", "/versions/15/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/15/tables/1/rows/1/description": "Default data directory location", "/versions/15/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/15/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "2b5bf61006437b5706fac6b24cbf42641efe99597b992ea159940afbe80bf61b"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 20.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-n"], "signature": "-n", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant server process could have corrupted some shared state before terminating. This option specifies that postgres will stop all other server processes by sending the signal SIGSTOP , but will not cause them to terminate. This permits system programmers to collect core dumps from all server processes by hand."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "847015c2bebc0c41bae7960e028128a24b26acdb50eedb78120be07145fbaade", "manual_language": "zh"}, "16": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "16.15"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "30"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 20 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 20.2 \u8282 \u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/16/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 19.9 \u8282 \u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 20.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 SIGQUIT \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001 SIGABRT \uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/16/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/16/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/16/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/16/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/16/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 20.2 for details.", "signature": "-D datadir", "source_url": "/docs/16/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 20.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/16/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/16/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/16/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/16/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/16/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 .", "signature": "-l", "source_url": "/docs/16/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/16/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/16/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/16/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 .", "signature": "-S work-mem", "source_url": "/docs/16/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/16/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/16/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/16/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/16/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/16/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/16/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/16/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/16/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "signature": "-T", "source_url": "/docs/16/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/16/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/16/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/16/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/16/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/16/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/16/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "16.15 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "01f9f5c4c4224aeda9fe80b4c01b751712035ffab3a5d29b3c92b3cad7765aee", "language": "en", "original_url": "/docs/16/app-postgres.html"}, {"url": "https://pg.center/docs/16/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "8aaa4422eece8f26d84715f855d9d0f7f87b200f8b82898c73c865ee42c2c70f", "language": "en", "original_url": "/docs/16/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.14.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/16/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/16/runtime-config-file-locations.html\" title=\"20.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a020.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/16/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/16/runtime-config.html\" title=\"\u7b2c\u00a020\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a020\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/16/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/16/runtime-config.html\" title=\"\u7b2c\u00a020\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a020\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u5927\u591a\u6570\u53c2\u6570\uff0c\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u5728\u8fd0\u884c\u4e2d\u7684\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5728\u8fd0\u884c\u65f6\u8ba1\u7b97\u51fa\u7684\u53c2\u6570\uff0c\u670d\u52a1\u5668\u5fc5\u987b\u5148\u5173\u95ed\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/16/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\">shared_memory_size</a>\u3001<a class=\"xref\" href=\"/docs/16/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\">shared_memory_size_in_huge_pages</a>\u548c<a class=\"xref\" href=\"/docs/16/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\">wal_segment_size</a>\uff09\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/16/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"link\" href=\"/docs/16/sql-show.html\" title=\"SHOW\"><code class=\"command\">SHOW</code></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/16/runtime-config-file-locations.html\" title=\"20.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a020.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/16/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/16/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/16/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/16/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/16/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 19.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/16/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/16/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"20.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a020.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<span class=\"systemitem\">SIGQUIT</span> \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001<span class=\"systemitem\">SIGABRT</span>\uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.14.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/16/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.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\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/16/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/16/kernel-resources.html\" title=\"19.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a019.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/16/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/16/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/16/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/16/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.27.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.27.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.14.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/16/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/16/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/16/app-postgres.html", "method": "same-major semantic node", "sha256": "31bcc3fe107506a22827f785072651b55a23390a7e9fda46ad1843cec773f780", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/16/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/16/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/16/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/16/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/16/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 20.2 for details.", "/versions/16/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/16/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/16/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/16/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/16/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 .", "/versions/16/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/16/tables/0/rows/12/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/16/tables/0/rows/13/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/16/tables/0/rows/14/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 .", "/versions/16/tables/0/rows/15/summary": "Print the postgres version and exit.", "/versions/16/tables/0/rows/16/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/16/tables/0/rows/17/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/16/tables/0/rows/18/summary": "Show help about postgres command line arguments, and exit.", "/versions/16/tables/0/rows/19/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/16/tables/0/rows/20/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/16/tables/0/rows/21/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/16/tables/0/rows/22/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/16/tables/0/rows/23/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "/versions/16/tables/0/rows/24/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/16/tables/0/rows/25/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/16/tables/0/rows/26/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/16/tables/0/rows/27/summary": "Echo all commands to standard output before executing them.", "/versions/16/tables/0/rows/28/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/16/tables/0/rows/29/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/16/tables/1/columns/0/label": "Variable", "/versions/16/tables/1/columns/1/label": "Meaning", "/versions/16/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/16/tables/1/rows/1/description": "Default data directory location", "/versions/16/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/16/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "104695e6995733455640364fe66ea9d5892b5d5eeff7d58093f9b9a4f131876e"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 20 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 20.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 19.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 20.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "b64856158655ec605c8a2e92bf987a2fcb0bc7d4e06bbba250c0fda662ef46a5", "manual_language": "zh"}, "17": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "17.11"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "30"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/17/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 SIGQUIT \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001 SIGABRT \uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/17/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/17/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/17/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/17/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/17/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/17/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/17/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/17/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/17/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/17/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/17/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/17/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/17/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/17/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/17/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/17/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/17/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/17/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/17/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/17/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/17/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/17/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/17/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/17/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "signature": "-T", "source_url": "/docs/17/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/17/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/17/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/17/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/17/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/17/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/17/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "17.11 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "bed2d1eca5e36c63572ffa6352c685cac3532abd0fe862634b8084ffc6fce30f", "language": "en", "original_url": "/docs/17/app-postgres.html"}, {"url": "https://pg.center/docs/17/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "01f07993ff020684f4c290d17cdafa26fb17ea5c1d476bc3a5efc68bf8ddd9b9", "language": "en", "original_url": "/docs/17/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.16.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/17/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/17/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/17/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/17/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/17/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/17/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u5927\u591a\u6570\u53c2\u6570\uff0c\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u5728\u8fd0\u884c\u4e2d\u7684\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5728\u8fd0\u884c\u65f6\u8ba1\u7b97\u51fa\u7684\u53c2\u6570\uff0c\u670d\u52a1\u5668\u5fc5\u987b\u5148\u5173\u95ed\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/17/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\">shared_memory_size</a>\u3001<a class=\"xref\" href=\"/docs/17/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\">shared_memory_size_in_huge_pages</a>\u548c<a class=\"xref\" href=\"/docs/17/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\">wal_segment_size</a>\uff09\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/17/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"link\" href=\"/docs/17/sql-show.html\" title=\"SHOW\"><code class=\"command\">SHOW</code></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/17/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/17/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/17/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/17/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/17/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/17/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/17/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/17/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<span class=\"systemitem\">SIGQUIT</span> \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001<span class=\"systemitem\">SIGABRT</span>\uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/17/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/17/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/17/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/17/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/17/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/17/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/17/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.28.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.28.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/17/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/17/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/17/app-postgres.html", "method": "same-major semantic node", "sha256": "62d25a350106ea8feb9df5be37b99961e9b430a870ba8af9668256d2e046ed82", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/17/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/17/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/17/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/17/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/17/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/17/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/17/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/17/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/17/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/17/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/17/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/17/tables/0/rows/12/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/17/tables/0/rows/13/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/17/tables/0/rows/14/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/17/tables/0/rows/15/summary": "Print the postgres version and exit.", "/versions/17/tables/0/rows/16/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/17/tables/0/rows/17/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/17/tables/0/rows/18/summary": "Show help about postgres command line arguments, and exit.", "/versions/17/tables/0/rows/19/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/17/tables/0/rows/20/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/17/tables/0/rows/21/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/17/tables/0/rows/22/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/17/tables/0/rows/23/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "/versions/17/tables/0/rows/24/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/17/tables/0/rows/25/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/17/tables/0/rows/26/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/17/tables/0/rows/27/summary": "Echo all commands to standard output before executing them.", "/versions/17/tables/0/rows/28/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/17/tables/0/rows/29/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/17/tables/1/columns/0/label": "Variable", "/versions/17/tables/1/columns/1/label": "Meaning", "/versions/17/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/17/tables/1/rows/1/description": "Default data directory location", "/versions/17/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/17/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "1abfa030e9619a4af3328243e0caa4fd1a16e890b5fb8cc3132b356adedb5387"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "30509748ef5aa6efd93c214ffb28fb9023e0efecf59598655674d069faddb18d", "manual_language": "zh"}, "18": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "18.6"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "30"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/18/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 SIGQUIT \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001 SIGABRT \uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/18/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/18/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/18/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/18/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/18/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/18/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/18/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/18/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/18/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/18/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/18/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/18/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/18/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/18/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/18/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/18/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "signature": "-T", "source_url": "/docs/18/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/18/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/18/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/18/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/18/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/18/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "18.6 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "7cc002e0a51fcdb1577e15fe6c728be6ed61dc0e6575c078234f0cbec1c7005d", "language": "en", "original_url": "/docs/18/app-postgres.html"}, {"url": "https://pg.center/docs/18/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3", "language": "en", "original_url": "/docs/18/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.16.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/18/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/18/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/18/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u5927\u591a\u6570\u53c2\u6570\uff0c\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u5728\u8fd0\u884c\u4e2d\u7684\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5728\u8fd0\u884c\u65f6\u8ba1\u7b97\u51fa\u7684\u53c2\u6570\uff0c\u670d\u52a1\u5668\u5fc5\u987b\u5148\u5173\u95ed\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\">shared_memory_size</a>\u3001<a class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\">shared_memory_size_in_huge_pages</a>\u548c<a class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\">wal_segment_size</a>\uff09\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"link\" href=\"/docs/18/sql-show.html\" title=\"SHOW\"><code class=\"command\">SHOW</code></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/18/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/18/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<span class=\"systemitem\">SIGQUIT</span> \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001<span class=\"systemitem\">SIGABRT</span>\uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/18/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/18/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.28.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.28.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/18/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/app-postgres.html", "method": "same-major semantic node", "sha256": "75ddf3b029a2bc3a690fa74931c2d2b6bde45e1525c50c002df6070fce83b082", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/18/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/18/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/18/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/18/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/18/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/18/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/18/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/18/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/18/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/18/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/18/tables/0/rows/12/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/18/tables/0/rows/13/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/18/tables/0/rows/14/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/18/tables/0/rows/15/summary": "Print the postgres version and exit.", "/versions/18/tables/0/rows/16/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/18/tables/0/rows/17/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/18/tables/0/rows/18/summary": "Show help about postgres command line arguments, and exit.", "/versions/18/tables/0/rows/19/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/18/tables/0/rows/20/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/18/tables/0/rows/21/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/18/tables/0/rows/22/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/18/tables/0/rows/23/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "/versions/18/tables/0/rows/24/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/18/tables/0/rows/25/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/18/tables/0/rows/26/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/18/tables/0/rows/27/summary": "Echo all commands to standard output before executing them.", "/versions/18/tables/0/rows/28/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/18/tables/0/rows/29/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/18/tables/1/columns/0/label": "Variable", "/versions/18/tables/1/columns/1/label": "Meaning", "/versions/18/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/18/tables/1/rows/1/description": "Default data directory location", "/versions/18/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/18/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "ac04c88353afb0193181ed3b85eec2b3e3e20fc3821ab0e64e32d55da4ce177a"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "30509748ef5aa6efd93c214ffb28fb9023e0efecf59598655674d069faddb18d", "manual_language": "zh"}, "19": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "19beta4"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "30"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/19/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 SIGQUIT \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001 SIGABRT \uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/19/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/19/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/19/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/19/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/19/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/19/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/19/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/19/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/19/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/19/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/19/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/19/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/19/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/19/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/19/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/19/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/19/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/19/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/19/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/19/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/19/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/19/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/19/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/19/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "signature": "-T", "source_url": "/docs/19/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/19/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/19/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/19/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/19/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/19/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/19/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "19beta4 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "66bbcba03dba80106950cb6ebb5661c98b86593c182df906d7d8e4d2248fad1a", "language": "en", "original_url": "/docs/19/app-postgres.html"}, {"url": "https://pg.center/docs/19/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "425b070323b448b5516d2cb4e9e4ac77efb5d19dd4e8005d0ae1c61db9ec78e6", "language": "en", "original_url": "/docs/19/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.16.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/19/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/19/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/19/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/19/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/19/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/19/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u5927\u591a\u6570\u53c2\u6570\uff0c\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u5728\u8fd0\u884c\u4e2d\u7684\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5728\u8fd0\u884c\u65f6\u8ba1\u7b97\u51fa\u7684\u53c2\u6570\uff0c\u670d\u52a1\u5668\u5fc5\u987b\u5148\u5173\u95ed\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/19/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\">shared_memory_size</a>\u3001<a class=\"xref\" href=\"/docs/19/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\">shared_memory_size_in_huge_pages</a>\u548c<a class=\"xref\" href=\"/docs/19/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\">wal_segment_size</a>\uff09\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/19/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"link\" href=\"/docs/19/sql-show.html\" title=\"SHOW\"><code class=\"command\">SHOW</code></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/19/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/19/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/19/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/19/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/19/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/19/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/19/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/19/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<span class=\"systemitem\">SIGQUIT</span> \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001<span class=\"systemitem\">SIGABRT</span>\uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/19/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/19/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/19/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/19/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/19/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/19/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/19/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.29.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.29.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/19/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/19/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/19/app-postgres.html", "method": "same-major semantic node", "sha256": "b02492265c7ec30bf22b650ee77fcb9afdddd8436f118d6e4d285ee264c34ac9", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/19/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/19/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/19/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/19/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/19/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/19/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/19/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/19/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/19/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/19/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/19/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/19/tables/0/rows/12/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/19/tables/0/rows/13/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/19/tables/0/rows/14/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/19/tables/0/rows/15/summary": "Print the postgres version and exit.", "/versions/19/tables/0/rows/16/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/19/tables/0/rows/17/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/19/tables/0/rows/18/summary": "Show help about postgres command line arguments, and exit.", "/versions/19/tables/0/rows/19/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/19/tables/0/rows/20/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/19/tables/0/rows/21/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/19/tables/0/rows/22/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/19/tables/0/rows/23/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "/versions/19/tables/0/rows/24/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/19/tables/0/rows/25/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/19/tables/0/rows/26/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/19/tables/0/rows/27/summary": "Echo all commands to standard output before executing them.", "/versions/19/tables/0/rows/28/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/19/tables/0/rows/29/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/19/tables/1/columns/0/label": "Variable", "/versions/19/tables/1/columns/1/label": "Meaning", "/versions/19/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/19/tables/1/rows/1/description": "Default data directory location", "/versions/19/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/19/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "5f6130d935b880ad34bf6d2d81468fdfdaca23c8b7c840417d5087d1fa3ba5b2"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "30509748ef5aa6efd93c214ffb28fb9023e0efecf59598655674d069faddb18d", "manual_language": "zh"}, "20": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "20devel"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "30"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 SIGQUIT \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001 SIGABRT \uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/devel/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/devel/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/devel/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/devel/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/devel/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/devel/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/devel/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/devel/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/devel/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/devel/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/devel/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/devel/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/devel/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/devel/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/devel/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/devel/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/devel/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/devel/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/devel/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/devel/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/devel/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/devel/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/devel/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/devel/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "signature": "-T", "source_url": "/docs/devel/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/devel/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/devel/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/devel/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/devel/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/devel/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/devel/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "20devel English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "5bd7e59770d0458bf04a872223ea49925cfb2c21545e33e1e21aa5cba2f5b85e", "language": "en", "original_url": "/docs/devel/app-postgres.html"}, {"url": "https://pg.center/docs/devel/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "5532c1ebfb8c6f310301be63a28daf0ae212e2a78025bea61a1bdca99e02c43d", "language": "en", "original_url": "/docs/devel/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.16.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/devel/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/devel/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/devel/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/devel/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/devel/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/devel/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u5927\u591a\u6570\u53c2\u6570\uff0c\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u5728\u8fd0\u884c\u4e2d\u7684\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5728\u8fd0\u884c\u65f6\u8ba1\u7b97\u51fa\u7684\u53c2\u6570\uff0c\u670d\u52a1\u5668\u5fc5\u987b\u5148\u5173\u95ed\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/devel/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\">shared_memory_size</a>\u3001<a class=\"xref\" href=\"/docs/devel/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\">shared_memory_size_in_huge_pages</a>\u548c<a class=\"xref\" href=\"/docs/devel/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\">wal_segment_size</a>\uff09\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/devel/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"link\" href=\"/docs/devel/sql-show.html\" title=\"SHOW\"><code class=\"command\">SHOW</code></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/devel/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/devel/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/devel/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/devel/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/devel/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/devel/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/devel/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/devel/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<span class=\"systemitem\">SIGQUIT</span> \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001<span class=\"systemitem\">SIGABRT</span>\uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/devel/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/devel/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/devel/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/devel/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/devel/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/devel/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/devel/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.29.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.29.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/devel/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/devel/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/devel/app-postgres.html", "method": "same-major semantic node", "sha256": "c5571ffa1436a9c8183642449d60d98cf3073367181d613fb5149887dfaa3ec9", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/summary": "postgres \u2014 PostgreSQL database server", "/category": "Server applications", "/versions/20/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/20/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/20/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/20/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/20/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/20/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/20/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/20/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/20/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/20/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/20/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/20/tables/0/rows/12/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/20/tables/0/rows/13/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/20/tables/0/rows/14/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/20/tables/0/rows/15/summary": "Print the postgres version and exit.", "/versions/20/tables/0/rows/16/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/20/tables/0/rows/17/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/20/tables/0/rows/18/summary": "Show help about postgres command line arguments, and exit.", "/versions/20/tables/0/rows/19/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/20/tables/0/rows/20/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/20/tables/0/rows/21/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/20/tables/0/rows/22/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/20/tables/0/rows/23/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "/versions/20/tables/0/rows/24/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/20/tables/0/rows/25/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/20/tables/0/rows/26/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/20/tables/0/rows/27/summary": "Echo all commands to standard output before executing them.", "/versions/20/tables/0/rows/28/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/20/tables/0/rows/29/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/20/tables/1/columns/0/label": "Variable", "/versions/20/tables/1/columns/1/label": "Meaning", "/versions/20/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/20/tables/1/rows/1/description": "Default data directory location", "/versions/20/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/20/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "a6a2eebf5b10d3fc6de54d20d9b0c0c5432baaaf48ee33830772fc70d28bee65"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "30509748ef5aa6efd93c214ffb28fb9023e0efecf59598655674d069faddb18d", "manual_language": "zh"}}}, "snapshot": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "postgres"}, {"label": "\u7a0b\u5e8f\u7248\u672c", "value": "18.6"}, {"label": "\u53c2\u8003\u6e05\u5355", "value": "\u670d\u52a1\u7aef\u7a0b\u5e8f"}, {"label": "\u9009\u9879\u5b9a\u4e49\u7ec4", "value": "30"}], "tables": [{"key": "options", "rows": [{"summary": "\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e shared_buffers \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-B nbuffers"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002 PostgreSQL \u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1 \u7b2c 19 \u7ae0 \u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002 -c \u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-c name = value"}}, {"summary": "\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684 -c \u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de postgresql.conf \u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-C name"}}, {"summary": "\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-d debug-level"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1 \u7b2c 19.2 \u8282 \u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-D datadir"}}, {"summary": "\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a \u201c European \u201d \uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 DMY \u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1 \u7b2c 8.5 \u8282 \u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-e"}}, {"summary": "\u7981\u7528 fsync \u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528 fsync \u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01", "signature": {"url": "/docs/18/app-postgres.html", "text": "-F"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528 * \u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c localhost \u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e listen_addresses \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-h hostname"}}, {"summary": "\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-i"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f /tmp \uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e unix_socket_directories \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-k directory"}}, {"summary": "\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u82e5\u8981\u4f7f\u7528\u6b64\u9009\u9879\uff0c PostgreSQL \u5fc5\u987b\u5728\u7f16\u8bd1\u65f6\u542f\u7528 SSL \u652f\u6301\u3002\u5173\u4e8e\u4f7f\u7528 SSL \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 \u7b2c 18.9 \u8282 \u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-l"}}, {"summary": "\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531 initdb \u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e max_connections \u914d\u7f6e\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-N max-connections"}}, {"summary": "\u6307\u5b9a postgres \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\u6216\u672c\u5730 Unix \u57df\u5957\u63a5\u5b57\u6587\u4ef6\u6269\u5c55\u540d\u3002\u9ed8\u8ba4\u503c\u53d6\u81ea PGPORT \u73af\u5883\u53d8\u91cf\uff1b\u5982\u679c PGPORT \u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216 PGPORT \u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-p port"}}, {"summary": "\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-s"}}, {"summary": "\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605 \u7b2c 19.4.1 \u8282 \u4e2d\u5bf9 work_mem \u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-S work-mem"}}, {"summary": "\u6253\u5370 postgres \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-V --version"}}, {"summary": "\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f -c \u7684\u8f83\u77ed\u5f62\u5f0f\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-- name = value"}}, {"summary": "\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684 COPY \u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "--describe-config"}}, {"summary": "\u663e\u793a postgres \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-? --help"}}, {"summary": "\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a s \u548c i \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c o \u3001 b \u548c t \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c n \u3001 m \u548c h \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-f { s | i | o | b | t | n | m | h }"}}, {"summary": "\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 initdb \u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-O"}}, {"summary": "\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-P"}}, {"summary": "\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e -s \u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-t pa[rser] | pl[anner] | e[xecutor]"}}, {"summary": "\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 SIGQUIT \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001 SIGABRT \uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-T"}}, {"summary": "\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-v protocol"}}, {"summary": "\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-W seconds"}}, {"summary": "\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "--single"}}, {"summary": "\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-E"}}, {"summary": "\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-j"}}, {"summary": "\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230 filename \u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002", "signature": {"url": "/docs/18/app-postgres.html", "text": "-r filename"}}], "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": "PGCLIENTENCODING", "description": "\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e"}, {"name": "PGDATESTYLE", "description": "DateStyle \u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09"}, {"name": "PGPORT", "description": "\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-B nbuffers"], "summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "signature": "-B nbuffers", "source_url": "/docs/18/app-postgres.html", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "signature": "-c name = value", "source_url": "/docs/18/app-postgres.html", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "signature": "-C name", "source_url": "/docs/18/app-postgres.html", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "signature": "-d debug-level", "source_url": "/docs/18/app-postgres.html", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "signature": "-D datadir", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "signature": "-e", "source_url": "/docs/18/app-postgres.html", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "signature": "-F", "source_url": "/docs/18/app-postgres.html", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "signature": "-h hostname", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "signature": "-i", "source_url": "/docs/18/app-postgres.html", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "signature": "-k directory", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "summary": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "signature": "-l", "source_url": "/docs/18/app-postgres.html", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "signature": "-N max-connections", "source_url": "/docs/18/app-postgres.html", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "signature": "-p port", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "signature": "-s", "source_url": "/docs/18/app-postgres.html", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "signature": "-S work-mem", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "summary": "Print the postgres version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-postgres.html", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "summary": "Sets a named run-time parameter; a shorter form of -c .", "signature": "-- name = value", "source_url": "/docs/18/app-postgres.html", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "signature": "--describe-config", "source_url": "/docs/18/app-postgres.html", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "summary": "Show help about postgres command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-postgres.html", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "signature": "-f { s | i | o | b | t | n | m | h }", "source_url": "/docs/18/app-postgres.html", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "summary": "Allows the structure of system tables to be modified. This is used by initdb .", "signature": "-O", "source_url": "/docs/18/app-postgres.html", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "signature": "-P", "source_url": "/docs/18/app-postgres.html", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "source_url": "/docs/18/app-postgres.html", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "signature": "-T", "source_url": "/docs/18/app-postgres.html", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "signature": "-v protocol", "source_url": "/docs/18/app-postgres.html", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "signature": "-W seconds", "source_url": "/docs/18/app-postgres.html", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "summary": "Selects the single-user mode. This must be the first argument on the command line.", "signature": "--single", "source_url": "/docs/18/app-postgres.html", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "summary": "Echo all commands to standard output before executing them.", "signature": "-E", "source_url": "/docs/18/app-postgres.html", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "signature": "-j", "source_url": "/docs/18/app-postgres.html", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "signature": "-r filename", "source_url": "/docs/18/app-postgres.html", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "related": [], "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-postgres.html", "file": "app-postgres.html", "label": "18.6 English manual \u00b7 app-postgres.html", "anchor": "", "sha256": "7cc002e0a51fcdb1577e15fe6c728be6ed61dc0e6575c078234f0cbec1c7005d", "language": "en", "original_url": "/docs/18/app-postgres.html"}, {"url": "https://pg.center/docs/18/reference-server.html", "file": "reference-server.html", "label": "Server applications inventory", "anchor": "", "sha256": "e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3", "language": "en", "original_url": "/docs/18/reference-server.html"}], "sections": [], "synopsis": ["postgres [ option ...]"], "signature": "postgres [ option ...]", "description": ["postgres \u2014 PostgreSQL \u6570\u636e\u5e93\u670d\u52a1\u5668"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}], "manual_html": "<div><div class=\"refentry\" id=\"APP-POSTGRES\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></h2>\n<p lang=\"zh\">postgres \u2014 <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668</p>\n</div>\n<div class=\"refsynopsisdiv\">\n<h2 lang=\"zh\">\u5927\u7eb2</h2>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.16.4.1\"><code class=\"command\">postgres</code> [<em class=\"replaceable\"><code>option</code></em>...]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.5\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u662f <span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\u3002\u5ba2\u6237\u7aef\u5e94\u7528\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u65f6\uff0c\u4f1a\uff08\u901a\u8fc7\u7f51\u7edc\u6216\u672c\u5730\uff09\u8fde\u63a5\u5230\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u8be5<code class=\"command\">postgres</code>\u5b9e\u4f8b\u968f\u540e\u4f1a\u542f\u52a8\u4e00\u4e2a\u72ec\u7acb\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u6765\u5904\u7406\u8be5\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u4e00\u4e2a<code class=\"command\">postgres</code>\u5b9e\u4f8b\u59cb\u7ec8\u53ea\u7ba1\u7406\u4e00\u4e2a\u6570\u636e\u5e93\u96c6\u7c07\u7684\u6570\u636e\u3002\u6570\u636e\u5e93\u96c6\u7c07\u662f\u4e00\u7ec4\u5b58\u50a8\u5728\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\uff08<span class=\"quote\">\u201c<span class=\"quote\">\u6570\u636e\u533a\u57df</span>\u201d</span>\uff09\u4e2d\u7684\u6570\u636e\u5e93\u3002\u53ea\u8981\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u533a\u57df\u548c\u4e0d\u540c\u7684\u901a\u4fe1\u7aef\u53e3\uff08\u89c1\u4e0b\u6587\uff09\uff0c\u4e00\u4e2a\u7cfb\u7edf\u4e0a\u5c31\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a <code class=\"command\">postgres</code>\u5b9e\u4f8b\u3002\u5f53 <code class=\"command\">postgres</code>\u542f\u52a8\u65f6\uff0c\u5b83\u9700\u8981\u77e5\u9053\u6570\u636e\u533a\u57df\u7684\u4f4d\u7f6e\u3002\u8be5\u4f4d\u7f6e\u5fc5\u987b\u901a\u8fc7 <code class=\"option\">-D</code>\u9009\u9879\u6216<code class=\"envar\">PGDATA</code>\u73af\u5883\u53d8\u91cf\u6307\u5b9a\uff1b\u6ca1\u6709\u9ed8\u8ba4\u503c\u3002\u901a\u5e38\uff0c<code class=\"option\">-D</code>\u6216 <code class=\"envar\">PGDATA</code>\u4f1a\u76f4\u63a5\u6307\u5411\u7531<a class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u521b\u5efa\u7684\u6570\u636e\u533a\u57df\u76ee\u5f55\u3002\u5176\u4ed6\u53ef\u80fd\u7684\u6587\u4ef6\u5e03\u5c40\u89c1<a class=\"xref\" href=\"/docs/18/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">postgres</code>\u5728\u524d\u53f0\u542f\u52a8\uff0c\u5e76\u5c06\u65e5\u5fd7\u6d88\u606f\u6253\u5370\u5230\u6807\u51c6\u9519\u8bef\u6d41\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c<code class=\"command\">postgres</code> \u5e94\u4f5c\u4e3a\u540e\u53f0\u8fdb\u7a0b\u542f\u52a8\uff0c\u4f8b\u5982\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u542f\u52a8\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u547d\u4ee4\u4e5f\u53ef\u4ee5\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\u8c03\u7528\u3002\u8fd9\u79cd\u6a21\u5f0f\u7684\u4e3b\u8981\u7528\u9014\u662f\u5728<a class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u6267\u884c\u5f15\u5bfc\u671f\u95f4\u4f7f\u7528\u3002\u6709\u65f6\u4e5f\u4f1a\u7528\u5b83\u6765\u8c03\u8bd5\u6216\u8fdb\u884c\u707e\u96be\u6062\u590d\uff1b\u4f46\u8bf7\u6ce8\u610f\uff0c\u8fd0\u884c\u5355\u7528\u6237\u670d\u52a1\u5668\u5176\u5b9e\u5e76\u4e0d\u9002\u5408\u8c03\u8bd5\u670d\u52a1\u5668\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u53d1\u751f\u771f\u5b9e\u7684\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u9501\u5b9a\u3002\u4ece shell \u4ee5\u5355\u7528\u6237\u6a21\u5f0f\u8c03\u7528\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u8f93\u5165\u67e5\u8be2\uff0c\u7ed3\u679c\u4f1a\u6253\u5370\u5230\u5c4f\u5e55\u4e0a\uff0c\u4f46\u5176\u5f62\u5f0f\u5bf9\u5f00\u53d1\u8005\u66f4\u6709\u7528\uff0c\u800c\u975e\u9762\u5411\u7ec8\u7aef\u7528\u6237\u3002\u5728\u5355\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u4f1a\u8bdd\u7528\u6237\u4f1a\u88ab\u8bbe\u7f6e\u4e3a ID \u4e3a 1 \u7684\u7528\u6237\uff0c\u5e76\u5411\u8be5\u7528\u6237\u9690\u5f0f\u6388\u4e88\u8d85\u7ea7\u7528\u6237\u6743\u9650\u3002\u8be5\u7528\u6237\u5b9e\u9645\u4e0a\u4e0d\u5fc5\u5b58\u5728\uff0c\u56e0\u6b64\u5355\u7528\u6237\u6a21\u5f0f\u53ef\u7528\u4e8e\u624b\u5de5\u6062\u590d\u7cfb\u7edf\u76ee\u5f55\u906d\u53d7\u67d0\u4e9b\u610f\u5916\u635f\u574f\u7684\u60c5\u51b5\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u63a5\u53d7\u4ee5\u4e0b\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6709\u5173\u8fd9\u4e9b\u9009\u9879\u7684\u8be6\u7ec6\u8ba8\u8bba\uff0c\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/18/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u901a\u8fc7\u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u7701\u53bb\u952e\u5165\u5176\u4e2d\u5927\u591a\u6570\u9009\u9879\u7684\u9ebb\u70e6\u3002\u67d0\u4e9b\uff08\u5b89\u5168\u7684\uff09\u9009\u9879\u8fd8\u53ef\u4ee5\u7531\u8fde\u63a5\u7684\u5ba2\u6237\u7aef\u4ee5\u5e94\u7528\u76f8\u5173\u7684\u65b9\u5f0f\u8bbe\u7f6e\uff0c\u5e76\u4e14\u4ec5\u5bf9\u8be5\u4f1a\u8bdd\u751f\u6548\u3002\u4f8b\u5982\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGOPTIONS</code>\uff0c\u90a3\u4e48\u57fa\u4e8e<span class=\"application\">libpq</span>\u7684\u5ba2\u6237\u7aef\u5c31\u4f1a\u5c06\u8be5\u5b57\u7b26\u4e32\u4f20\u7ed9\u670d\u52a1\u5668\uff0c\u670d\u52a1\u5668\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a <code class=\"command\">postgres</code>\u547d\u4ee4\u884c\u9009\u9879\u3002</p>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.3\">\n<h3 lang=\"zh\">\u901a\u7528\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-B <em class=\"replaceable\"><code>nbuffers</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4f9b\u670d\u52a1\u5668\u8fdb\u7a0b\u4f7f\u7528\u7684\u5171\u4eab\u7f13\u51b2\u533a\u6570\u91cf\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-c <em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u3002<span class=\"productname\">PostgreSQL</span>\u652f\u6301\u7684\u914d\u7f6e\u53c2\u6570\u89c1<a class=\"xref\" href=\"/docs/18/runtime-config.html\" title=\"\u7b2c\u00a019\u00a0\u7ae0\u00a0\u670d\u52a1\u5668\u914d\u7f6e\">\u7b2c\u00a019\u00a0\u7ae0</a>\u3002\u5927\u591a\u6570\u5176\u4ed6\u547d\u4ee4\u884c\u9009\u9879\u5b9e\u9645\u4e0a\u90fd\u662f\u8fd9\u79cd\u53c2\u6570\u8d4b\u503c\u7684\u7b80\u5199\u5f62\u5f0f\u3002<code class=\"option\">-c</code>\u53ef\u4ee5\u51fa\u73b0\u591a\u6b21\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-C <em class=\"replaceable\"><code>name</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6253\u5370\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u503c\u5e76\u9000\u51fa\u3002\uff08\u8be6\u60c5\u89c1\u4e0a\u9762\u7684<code class=\"option\">-c</code>\u9009\u9879\u3002\uff09\u8fd9\u4f1a\u8fd4\u56de <code class=\"filename\">postgresql.conf</code>\u4e2d\u7684\u503c\uff0c\u5e76\u5e94\u7528\u672c\u6b21\u8c03\u7528\u4e2d\u63d0\u4f9b\u7684\u4efb\u4f55\u53c2\u6570\u4fee\u6539\u3002\u5b83\u4e0d\u53cd\u6620\u96c6\u7c07\u542f\u52a8\u65f6\u63d0\u4f9b\u7684\u53c2\u6570\u3002</p>\n<p lang=\"zh\">\u5bf9\u4e8e\u5927\u591a\u6570\u53c2\u6570\uff0c\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u5728\u8fd0\u884c\u4e2d\u7684\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u3002\u4e0d\u8fc7\uff0c\u5bf9\u4e8e\u67d0\u4e9b\u5728\u8fd0\u884c\u65f6\u8ba1\u7b97\u51fa\u7684\u53c2\u6570\uff0c\u670d\u52a1\u5668\u5fc5\u987b\u5148\u5173\u95ed\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\">shared_memory_size</a>\u3001<a class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\">shared_memory_size_in_huge_pages</a>\u548c<a class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\">wal_segment_size</a>\uff09\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u4f9b\u5176\u4ed6\u4e0e\u670d\u52a1\u5668\u5b9e\u4f8b\u4ea4\u4e92\u7684\u7a0b\u5e8f\uff08\u4f8b\u5982<a class=\"xref\" href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\uff09\u67e5\u8be2\u914d\u7f6e\u53c2\u6570\u503c\u4e4b\u7528\u3002\u9762\u5411\u7528\u6237\u7684\u5e94\u7528\u5219\u5e94\u4f7f\u7528<a class=\"link\" href=\"/docs/18/sql-show.html\" title=\"SHOW\"><code class=\"command\">SHOW</code></a>\u6216<code class=\"structname\">pg_settings</code>\u89c6\u56fe\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-d <em class=\"replaceable\"><code>debug-level</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u8bbe\u7f6e\u8c03\u8bd5\u7ea7\u522b\u3002\u503c\u8d8a\u5927\uff0c\u5199\u5165\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u8c03\u8bd5\u8f93\u51fa\u8d8a\u591a\u3002\u53d6\u503c\u8303\u56f4\u4e3a 1 \u5230 5\u3002\u4e5f\u53ef\u4ee5\u4e3a\u7279\u5b9a\u4f1a\u8bdd\u4f20\u5165 -d 0\uff0c\u963b\u6b62\u7236 postgres \u8fdb\u7a0b\u7684\u670d\u52a1\u5668\u65e5\u5fd7\u7ea7\u522b\u4f20\u64ad\u5230\u8be5\u4f1a\u8bdd\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u4f4d\u7f6e\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/18/runtime-config-file-locations.html\" title=\"19.2.\u00a0\u6587\u4ef6\u4f4d\u7f6e\">\u7b2c\u00a019.2\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-e</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u9ed8\u8ba4\u65e5\u671f\u98ce\u683c\u8bbe\u7f6e\u4e3a<span class=\"quote\">\u201c<span class=\"quote\">European</span>\u201d</span>\uff0c\u5373\u8f93\u5165\u65e5\u671f\u5b57\u6bb5\u91c7\u7528 <code class=\"literal\">DMY</code>\u987a\u5e8f\u3002\u8fd9\u4e5f\u4f1a\u5728\u67d0\u4e9b\u65e5\u671f\u8f93\u51fa\u683c\u5f0f\u4e2d\u4f7f\u65e5\u671f\u663e\u793a\u4e3a\u65e5\u5728\u6708\u524d\u3002\u66f4\u591a\u4fe1\u606f\u89c1<a class=\"xref\" href=\"/docs/18/datatype-datetime.html\" title=\"8.5.\u00a0\u65e5\u671f/\u65f6\u95f4\u7c7b\u578b\">\u7b2c\u00a08.5\u00a0\u8282</a>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-F</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7981\u7528<code class=\"function\">fsync</code>\u8c03\u7528\u4ee5\u63d0\u9ad8\u6027\u80fd\uff0c\u4f46\u5728\u7cfb\u7edf\u5d29\u6e83\u65f6\u4f1a\u6709\u6570\u636e\u635f\u574f\u7684\u98ce\u9669\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u7981\u7528<a class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-FSYNC\">fsync</a>\u914d\u7f6e\u53c2\u6570\u3002\u4f7f\u7528\u524d\u8bf7\u5148\u9605\u8bfb\u8be6\u7ec6\u6587\u6863\uff01</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-h <em class=\"replaceable\"><code>hostname</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u6765\u81ea\u5ba2\u6237\u7aef\u5e94\u7528\u7684 TCP/IP \u8fde\u63a5\u7684 IP \u4e3b\u673a\u540d\u6216\u5730\u5740\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u5730\u5740\u5217\u8868\uff0c\u6216\u8005\u7528<code class=\"literal\">*</code>\u6307\u5b9a\u4fa6\u542c\u6240\u6709\u53ef\u7528\u63a5\u53e3\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 IP \u5730\u5740\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 Unix \u57df\u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u53ea\u4fa6\u542c <span class=\"systemitem\">localhost</span>\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-i</code></span></dt>\n<dd>\n<p lang=\"zh\">\u5141\u8bb8\u8fdc\u7a0b\u5ba2\u6237\u7aef\u901a\u8fc7 TCP/IP\uff08\u4e92\u8054\u7f51\u57df\uff09\u8fde\u63a5\u3002\u6ca1\u6709\u6b64\u9009\u9879\u65f6\uff0c\u53ea\u63a5\u53d7\u672c\u5730\u8fde\u63a5\u3002\u6b64\u9009\u9879\u7b49\u540c\u4e8e\u5728 postgresql.conf \u4e2d\u6216\u901a\u8fc7 -h \u5c06 listen_addresses \u8bbe\u4e3a *\u3002</p>\n<p lang=\"zh\">\u8be5\u9009\u9879\u5df2\u88ab\u5f03\u7528\uff0c\u56e0\u4e3a\u5b83\u65e0\u6cd5\u8bbf\u95ee<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\">listen_addresses</a>\u7684\u5168\u90e8\u529f\u80fd\u3002\u901a\u5e38\u6700\u597d\u76f4\u63a5\u8bbe\u7f6e<code class=\"varname\">listen_addresses</code>\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-k <em class=\"replaceable\"><code>directory</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code>\u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 Unix \u57df\u5957\u63a5\u5b57\u6240\u5728\u76ee\u5f55\u3002\u8be5\u503c\u4e5f\u53ef\u4ee5\u662f\u9017\u53f7\u5206\u9694\u7684\u76ee\u5f55\u5217\u8868\u3002\u7a7a\u503c\u8868\u793a\u4e0d\u4fa6\u542c\u4efb\u4f55 Unix \u57df\u5957\u63a5\u5b57\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ea\u80fd\u4f7f\u7528 TCP/IP \u5957\u63a5\u5b57\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002\u9ed8\u8ba4\u503c\u901a\u5e38\u662f <code class=\"filename\">/tmp</code>\uff0c\u4f46\u53ef\u4ee5\u5728\u7f16\u8bd1\u65f6\u66f4\u6539\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\">unix_socket_directories</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l</code></span></dt>\n<dd>\n<p lang=\"zh\">\u542f\u7528\u4f7f\u7528 SSL \u7684\u5b89\u5168\u8fde\u63a5\u3002\u53ea\u6709\u5728\u6784\u5efa PostgreSQL \u65f6\u542f\u7528\u4e86 SSL \u652f\u6301\uff0c\u6b64\u9009\u9879\u624d\u53ef\u7528\u3002\u6709\u5173 SSL \u4f7f\u7528\u65b9\u6cd5\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u7b2c 18.9 \u8282\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>max-connections</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u8be5\u670d\u52a1\u5668\u5c06\u63a5\u53d7\u7684\u6700\u5927\u5ba2\u6237\u7aef\u8fde\u63a5\u6570\u3002\u8be5\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u7531<span class=\"application\">initdb</span>\u81ea\u52a8\u9009\u62e9\u3002\u6307\u5b9a\u6b64\u9009\u9879\u7b49\u6548\u4e8e\u8bbe\u7f6e<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u914d\u7f6e\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>port</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a<code class=\"command\">postgres</code> \u7528\u6765\u4fa6\u542c\u5ba2\u6237\u7aef\u5e94\u7528\u8fde\u63a5\u7684 TCP/IP \u7aef\u53e3\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\uff1b\u5982\u679c<code class=\"envar\">PGPORT</code>\u672a\u8bbe\u7f6e\uff0c\u5219\u9ed8\u8ba4\u503c\u5c31\u662f\u5728\u7f16\u8bd1\u671f\u95f4\u786e\u5b9a\u7684\u503c\uff08\u901a\u5e38\u4e3a 5432\uff09\u3002\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u975e\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90a3\u4e48\u6240\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u90fd\u5fc5\u987b\u901a\u8fc7\u547d\u4ee4\u884c\u9009\u9879\u6216<code class=\"envar\">PGPORT</code>\u6307\u5b9a\u76f8\u540c\u7684\u7aef\u53e3\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6bcf\u6761\u547d\u4ee4\u7ed3\u675f\u65f6\u6253\u5370\u65f6\u95f4\u4fe1\u606f\u548c\u5176\u4ed6\u7edf\u8ba1\u4fe1\u606f\u3002\u8fd9\u5bf9\u57fa\u51c6\u6d4b\u8bd5\u6216\u8005\u8c03\u6574\u7f13\u51b2\u533a\u6570\u91cf\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S</code> <em class=\"replaceable\"><code>work-mem</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u6392\u5e8f\u548c hash \u8868\u5728\u8f6c\u800c\u4f7f\u7528\u4e34\u65f6\u78c1\u76d8\u6587\u4ef6\u4e4b\u524d\u53ef\u4f7f\u7528\u7684\u57fa\u7840\u5185\u5b58\u91cf\u3002\u8bf7\u53c2\u9605<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1.\u00a0\u5185\u5b58\">\u7b2c\u00a019.4.1\u00a0\u8282</a>\u4e2d\u5bf9<code class=\"varname\">work_mem</code>\u914d\u7f6e\u53c2\u6570\u7684\u8bf4\u660e\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\">postgres</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--<em class=\"replaceable\"><code>name</code></em>=<em class=\"replaceable\"><code>value</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\uff1b\u8fd9\u662f<code class=\"option\">-c</code>\u7684\u8f83\u77ed\u5f62\u5f0f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">--describe-config</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u4f1a\u4ee5\u5236\u8868\u7b26\u5206\u9694\u7684<code class=\"command\">COPY</code>\u683c\u5f0f\u5bfc\u51fa\u670d\u52a1\u5668\u5185\u90e8\u914d\u7f6e\u53d8\u91cf\u3001\u8bf4\u660e\u4ee5\u53ca\u9ed8\u8ba4\u503c\u3002\u5b83\u4e3b\u8981\u662f\u4e3a\u7ba1\u7406\u5de5\u5177\u8bbe\u8ba1\u7684\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<span class=\"application\">postgres</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.4\">\n<h3 lang=\"zh\">\u534a\u5185\u90e8\u9009\u9879</h3>\n<p lang=\"zh\">\u8fd9\u91cc\u63cf\u8ff0\u7684\u9009\u9879\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5\uff0c\u5e76\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u534f\u52a9\u6062\u590d\u4e25\u91cd\u635f\u574f\u7684\u6570\u636e\u5e93\u3002\u5728\u751f\u4ea7\u6570\u636e\u5e93\u73af\u5883\u4e2d\u6ca1\u6709\u7406\u7531\u4f7f\u7528\u5b83\u4eec\u3002\u8fd9\u91cc\u5217\u51fa\u8fd9\u4e9b\u9009\u9879\uff0c\u4ec5\u4f9b<span class=\"productname\">PostgreSQL</span> \u7cfb\u7edf\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u6b64\u5916\uff0c\u8fd9\u4e9b\u9009\u9879\u5728\u672a\u6765\u7248\u672c\u4e2d\u53ef\u80fd\u4f1a\u66f4\u6539\u6216\u88ab\u79fb\u9664\uff0c\u4e14\u4e0d\u53e6\u884c\u901a\u77e5\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-f</code> <code class=\"literal\">{ s | i | o | b | t | n | m | h }</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7981\u6b62\u4f7f\u7528\u67d0\u4e9b\u626b\u63cf\u548c\u8fde\u63a5\u65b9\u6cd5\uff1a<code class=\"literal\">s</code>\u548c<code class=\"literal\">i</code> \u5206\u522b\u7981\u7528\u987a\u5e8f\u626b\u63cf\u548c\u7d22\u5f15\u626b\u63cf\uff0c<code class=\"literal\">o</code>\u3001<code class=\"literal\">b</code>\u548c<code class=\"literal\">t</code> \u5206\u522b\u7981\u7528\u4ec5\u7d22\u5f15\u626b\u63cf\u3001\u4f4d\u56fe\u7d22\u5f15\u626b\u63cf\u548c TID \u626b\u63cf\uff0c\u800c<code class=\"literal\">n</code>\u3001<code class=\"literal\">m</code>\u548c<code class=\"literal\">h</code> \u5219\u5206\u522b\u7981\u7528\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u3001\u5f52\u5e76\u8fde\u63a5\u548c\u54c8\u5e0c\u8fde\u63a5\u3002</p>\n<p lang=\"zh\">\u987a\u5e8f\u626b\u63cf\u548c\u5d4c\u5957\u5faa\u73af\u8fde\u63a5\u90fd\u65e0\u6cd5\u88ab\u5b8c\u5168\u7981\u7528\uff1b<code class=\"literal\">-fs</code>\u548c <code class=\"literal\">-fn</code>\u9009\u9879\u53ea\u662f\u5728\u4f18\u5316\u5668\u6709\u5176\u4ed6\u9009\u62e9\u65f6\uff0c\u5c3d\u91cf\u4e0d\u4f7f\u7528\u8fd9\u4e9b\u8ba1\u5212\u7c7b\u578b\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-O</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5141\u8bb8\u4fee\u6539\u7cfb\u7edf\u8868\u7684\u7ed3\u6784\u3002\u8be5\u9009\u9879\u7531 <code class=\"command\">initdb</code>\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8bfb\u53d6\u7cfb\u7edf\u8868\u65f6\u5ffd\u7565\u7cfb\u7edf\u7d22\u5f15\uff0c\u4f46\u5728\u4fee\u6539\u8868\u65f6\u4ecd\u7136\u66f4\u65b0\u8fd9\u4e9b\u7d22\u5f15\u3002\u8fd9\u5728\u4ece\u635f\u574f\u7684\u7cfb\u7edf\u7d22\u5f15\u4e2d\u6062\u590d\u65f6\u5f88\u6709\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t</code> <code class=\"literal\">pa[rser] | pl[anner] | e[xecutor]</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370\u4e0e\u5404\u4e2a\u4e3b\u8981\u7cfb\u7edf\u6a21\u5757\u76f8\u5173\u7684\u6bcf\u4e2a\u67e5\u8be2\u7684\u65f6\u95f4\u7edf\u8ba1\u4fe1\u606f\u3002\u8be5\u9009\u9879\u4e0d\u80fd\u4e0e<code class=\"option\">-s</code>\u9009\u9879\u4e00\u8d77\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-T</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8be5\u9009\u9879\u7528\u4e8e\u8c03\u8bd5\u5bfc\u81f4\u670d\u52a1\u5668\u8fdb\u7a0b\u5f02\u5e38\u7ec8\u6b62\u7684\u95ee\u9898\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u901a\u5e38\u7684\u7b56\u7565\u662f\u901a\u8fc7\u5411\u6240\u6709\u5176\u4ed6\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<span class=\"systemitem\">SIGQUIT</span> \u4fe1\u53f7\uff0c\u901a\u77e5\u5b83\u4eec\u5fc5\u987b\u7ec8\u6b62\u3002\u4f7f\u7528\u6b64\u9009\u9879\u65f6\uff0c\u5219\u4f1a\u6539\u4e3a\u53d1\u9001<span class=\"systemitem\">SIGABRT</span>\uff0c\u4ece\u800c\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-v</code> <em class=\"replaceable\"><code>protocol</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7279\u5b9a\u4f1a\u8bdd\u8981\u4f7f\u7528\u7684\u524d\u7aef/\u540e\u7aef\u534f\u8bae\u7248\u672c\u53f7\u3002\u8be5\u9009\u9879\u4ec5\u4f9b\u5185\u90e8\u4f7f\u7528\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code> <em class=\"replaceable\"><code>seconds</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u65b0\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u5b8c\u6210\u8ba4\u8bc1\u8fc7\u7a0b\u540e\uff0c\u4f1a\u5ef6\u8fdf\u8fd9\u4e48\u591a\u79d2\u3002\u8fd9\u662f\u4e3a\u4e86\u7ed9\u8c03\u8bd5\u5668\u9644\u7740\u5230\u8be5\u670d\u52a1\u5668\u8fdb\u7a0b\u63d0\u4f9b\u673a\u4f1a\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect2\" id=\"id-1.9.5.16.6.5\">\n<h3 lang=\"zh\">\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\u7684\u9009\u9879</h3>\n<p lang=\"zh\">\u4ee5\u4e0b\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5355\u7528\u6237\u6a21\u5f0f\uff08\u89c1\u4e0b\u6587<a class=\"xref\" href=\"/docs/18/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"\u5355\u7528\u6237\u6a21\u5f0f\">Single-User Mode</a>\uff09\u3002</p>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">--single</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9009\u62e9\u5355\u7528\u6237\u6a21\u5f0f\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><em class=\"replaceable\"><code>database</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u540d\u79f0\u3002\u8fd9\u5fc5\u987b\u662f\u547d\u4ee4\u884c\u4e0a\u7684\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u3002\u5982\u679c\u7701\u7565\uff0c\u5219\u9ed8\u8ba4\u4e3a\u7528\u6237\u540d\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-E</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u6267\u884c\u524d\u5c06\u6240\u6709\u547d\u4ee4\u56de\u663e\u5230\u6807\u51c6\u8f93\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-j</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u4f7f\u7528\u201c\u5206\u53f7\u540e\u8ddf\u4e24\u4e2a\u6362\u884c\u7b26\u201d\u800c\u4e0d\u662f\u5355\u4e2a\u6362\u884c\u7b26\uff0c\u4f5c\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-r</code> <em class=\"replaceable\"><code>filename</code></em></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u6240\u6709\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u53d1\u9001\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u53ea\u6709\u5c06\u6b64\u9009\u9879\u4f5c\u4e3a\u547d\u4ee4\u884c\u9009\u9879\u63d0\u4f9b\u65f6\uff0c\u5b83\u624d\u4f1a\u751f\u6548\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCLIENTENCODING</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b57\u7b26\u7f16\u7801\u3002\uff08\u5ba2\u6237\u7aef\u53ef\u4ee5\u5355\u72ec\u8986\u76d6\u5b83\u3002\uff09\u8be5\u503c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATA</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGDATESTYLE</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><a class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-DATESTYLE\">DateStyle</a>\u8fd0\u884c\u65f6\u53c2\u6570\u7684\u9ed8\u8ba4\u503c\u3002\uff08\u8be5\u73af\u5883\u53d8\u91cf\u7684\u7528\u6cd5\u5df2\u88ab\u5f03\u7528\u3002\uff09</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"envar\">PGPORT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u9ed8\u8ba4\u7aef\u53e3\u53f7\uff08\u6700\u597d\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bbe\u7f6e\uff09</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.8\">\n<h2 lang=\"zh\">\u8bca\u65ad</h2>\n<p lang=\"zh\">\u63d0\u5230<code class=\"literal\">semget</code>\u6216 <code class=\"literal\">shmget</code>\u7684\u5931\u8d25\u6d88\u606f\uff0c\u5f88\u53ef\u80fd\u8868\u660e\u4f60\u9700\u8981\u914d\u7f6e\u5185\u6838\uff0c\u4ee5\u63d0\u4f9b\u8db3\u591f\u7684\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\u3002\u66f4\u591a\u8ba8\u8bba\u89c1<a class=\"xref\" href=\"/docs/18/kernel-resources.html\" title=\"18.4.\u00a0\u7ba1\u7406\u5185\u6838\u8d44\u6e90\">\u7b2c\u00a018.4\u00a0\u8282</a>\u3002\u4f60\u4e5f\u8bb8\u53ef\u4ee5\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\">shared_buffers</a>\u6765\u51cf\u5c11<span class=\"productname\">PostgreSQL</span>\u7684\u5171\u4eab\u5185\u5b58\u6d88\u8017\uff0c\u4ee5\u53ca/\u6216\u901a\u8fc7\u964d\u4f4e<a class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\">max_connections</a>\u6765\u51cf\u5c11\u4fe1\u53f7\u91cf\u6d88\u8017\uff0c\u4ece\u800c\u63a8\u8fdf\u91cd\u65b0\u914d\u7f6e\u5185\u6838\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u53e6\u4e00\u4e2a\u670d\u52a1\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5931\u8d25\u6d88\u606f\u5e94\u4ed4\u7ec6\u68c0\u67e5\uff0c\u4f8b\u5982\u53ef\u6839\u636e\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps ax | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u6216</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>ps -ef | grep postgres</code></strong>\n</pre>\n<p lang=\"zh\">\u5982\u679c\u4f60\u786e\u4fe1\u6ca1\u6709\u51b2\u7a81\u7684\u670d\u52a1\u5668\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u5220\u9664\u6d88\u606f\u4e2d\u63d0\u5230\u7684\u9501\u6587\u4ef6\uff0c\u7136\u540e\u91cd\u8bd5\u3002</p>\n<p lang=\"zh\">\u8868\u660e\u65e0\u6cd5\u7ed1\u5b9a\u7aef\u53e3\u7684\u5931\u8d25\u6d88\u606f\uff0c\u53ef\u80fd\u610f\u5473\u7740\u8be5\u7aef\u53e3\u5df2\u7ecf\u88ab\u67d0\u4e2a\u975e<span class=\"productname\">PostgreSQL</span>\u8fdb\u7a0b\u5360\u7528\u3002\u4f60\u5728\u7ec8\u6b62<code class=\"command\">postgres</code> \u540e\u5982\u679c\u7acb\u5373\u4f7f\u7528\u540c\u4e00\u7aef\u53e3\u91cd\u65b0\u542f\u52a8\u5b83\uff0c\u4e5f\u53ef\u80fd\u4f1a\u5f97\u5230\u8fd9\u4e2a\u9519\u8bef\uff1b\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ea\u9700\u7b49\u5f85\u51e0\u79d2\u949f\uff0c\u76f4\u5230\u64cd\u4f5c\u7cfb\u7edf\u5173\u95ed\u8be5\u7aef\u53e3\u540e\u518d\u91cd\u8bd5\u3002\u6700\u540e\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u8ba4\u4e3a\u662f\u4fdd\u7559\u7684\u7aef\u53e3\u53f7\uff0c\u4e5f\u53ef\u80fd\u4f1a\u6536\u5230\u8fd9\u4e2a\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u8bb8\u591a\u7248\u672c\u7684 Unix \u8ba4\u4e3a\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u53f7\u662f<span class=\"quote\">\u201c<span class=\"quote\">\u53d7\u4fe1\u4efb\u7684</span>\u201d</span>\uff0c\u5e76\u4e14\u53ea\u5141\u8bb8 Unix \u8d85\u7ea7\u7528\u6237\u8bbf\u95ee\u5b83\u4eec\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.9\">\n<h2 lang=\"zh\">\u6ce8\u89e3</h2>\n<p lang=\"zh\">\u5b9e\u7528\u547d\u4ee4<a class=\"xref\" href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a>\u53ef\u7528\u4e8e\u5b89\u5168\u3001\u4fbf\u6377\u5730\u542f\u52a8\u548c\u5173\u95ed<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002</p>\n<p lang=\"zh\">\u53ea\u8981\u6709\u53ef\u80fd\uff0c\u5c31<span class=\"emphasis\"><em>\u4e0d\u8981</em></span>\u4f7f\u7528 <code class=\"literal\">SIGKILL</code>\u6740\u6b7b\u4e3b <code class=\"command\">postgres</code>\u670d\u52a1\u5668\u3002\u8fd9\u6837\u4f1a\u963b\u6b62 <code class=\"command\">postgres</code>\u5728\u7ec8\u6b62\u524d\u91ca\u653e\u5176\u6301\u6709\u7684\u7cfb\u7edf\u8d44\u6e90\uff08\u4f8b\u5982\u5171\u4eab\u5185\u5b58\u548c\u4fe1\u53f7\u91cf\uff09\u3002\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u7684<code class=\"command\">postgres</code>\u5b9e\u4f8b\u5728\u542f\u52a8\u65f6\u51fa\u73b0\u95ee\u9898\u3002</p>\n<p lang=\"zh\">\u8981\u6b63\u5e38\u7ec8\u6b62<code class=\"command\">postgres</code>\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528 <code class=\"literal\">SIGTERM</code>\u3001<code class=\"literal\">SIGINT</code>\u6216 <code class=\"literal\">SIGQUIT</code>\u4fe1\u53f7\u3002\u7b2c\u4e00\u4e2a\u4f1a\u5728\u9000\u51fa\u524d\u7b49\u5f85\u6240\u6709\u5ba2\u6237\u7aef\u7ec8\u6b62\uff0c\u7b2c\u4e8c\u4e2a\u4f1a\u5f3a\u5236\u65ad\u5f00\u6240\u6709\u5ba2\u6237\u7aef\uff0c\u800c\u7b2c\u4e09\u4e2a\u4f1a\u5728\u4e0d\u8fdb\u884c\u6b63\u786e\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u7acb\u5373\u9000\u51fa\uff0c\u4ece\u800c\u5728\u91cd\u542f\u671f\u95f4\u5bfc\u81f4\u4e00\u6b21\u6062\u590d\u8fd0\u884c\u3002</p>\n<p lang=\"zh\"><code class=\"literal\">SIGHUP</code>\u4fe1\u53f7\u4f1a\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\u3002\u4e5f\u53ef\u4ee5\u5411\u5355\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001 <code class=\"literal\">SIGHUP</code>\uff0c\u4f46\u8fd9\u901a\u5e38\u6ca1\u6709\u610f\u4e49\u3002</p>\n<p lang=\"zh\">\u8981\u53d6\u6d88\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u67e5\u8be2\uff0c\u53ef\u4ee5\u5411\u6267\u884c\u8be5\u547d\u4ee4\u7684\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGINT</code>\u4fe1\u53f7\u3002\u8981\u5e72\u51c0\u5730\u7ec8\u6b62\u4e00\u4e2a\u540e\u7aef\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u5411\u8be5\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGTERM</code>\u3002\u8fd9\u4e24\u79cd\u64cd\u4f5c\u5728 SQL \u4e2d\u53ef\u8c03\u7528\u7684\u7b49\u6548\u5f62\u5f0f\uff0c\u89c1<a class=\"xref\" href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.28.2.\u00a0\u670d\u52a1\u5668\u4fe1\u53f7\u51fd\u6570\">\u7b2c\u00a09.28.2\u00a0\u8282</a>\u4e2d\u7684<code class=\"function\">pg_cancel_backend</code>\u548c<code class=\"function\">pg_terminate_backend</code>\u3002</p>\n<p lang=\"zh\"><code class=\"command\">postgres</code>\u670d\u52a1\u5668\u4f7f\u7528<code class=\"literal\">SIGQUIT</code> \u901a\u77e5\u4ece\u5c5e\u670d\u52a1\u5668\u8fdb\u7a0b\u5728\u4e0d\u8fdb\u884c\u6b63\u5e38\u6e05\u7406\u7684\u60c5\u51b5\u4e0b\u7ec8\u6b62\u3002\u7528\u6237<span class=\"emphasis\"><em>\u4e0d\u5e94\u8be5</em></span>\u4f7f\u7528\u8fd9\u4e2a\u4fe1\u53f7\u3002\u5411\u67d0\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001<code class=\"literal\">SIGKILL</code>\u4e5f\u662f\u4e0d\u660e\u667a\u7684 \u2014 \u4e3b<code class=\"command\">postgres</code>\u8fdb\u7a0b\u4f1a\u5c06\u5176\u89e3\u91ca\u4e3a\u4e00\u6b21\u5d29\u6e83\uff0c\u5e76\u4f5c\u4e3a\u5176\u6807\u51c6\u5d29\u6e83\u6062\u590d\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u5f3a\u5236\u6240\u6709\u540c\u7ea7\u8fdb\u7a0b\u9000\u51fa\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-BUGS\">\n<h2 lang=\"zh\">\u7f3a\u9677</h2>\n<p lang=\"zh\"><code class=\"option\">--</code>\u9009\u9879\u5728<span class=\"systemitem\">FreeBSD</span>\u6216<span class=\"systemitem\">OpenBSD</span>\u4e0a\u4e0d\u8d77\u4f5c\u7528\u3002\u8bf7\u6539\u7528<code class=\"option\">-c</code>\u3002\u8fd9\u662f\u53d7\u5f71\u54cd\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7f3a\u9677\uff1b\u5982\u679c\u8fd9\u4e2a\u95ee\u9898\u672a\u88ab\u4fee\u590d\uff0c\u672a\u6765\u7248\u672c\u7684<span class=\"productname\">PostgreSQL</span> \u5c06\u63d0\u4f9b\u53d8\u901a\u65b9\u6848\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\">\n<h2 lang=\"zh\">\u5355\u7528\u6237\u6a21\u5f0f</h2>\n<p lang=\"zh\">\u8981\u542f\u52a8\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u4f3c\u4e0b\u9762\u7684\u547d\u4ee4\uff1a</p>\n<pre class=\"screen\"><strong class=\"userinput\"><code>postgres --single -D /usr/local/pgsql/data <em class=\"replaceable\"><code>other-options</code></em> my_database</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528<code class=\"option\">-D</code>\u63d0\u4f9b\u6b63\u786e\u7684\u6570\u636e\u5e93\u76ee\u5f55\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002\u8fd8\u8981\u6307\u5b9a\u4f60\u60f3\u8981\u64cd\u4f5c\u7684\u90a3\u4e2a\u6570\u636e\u5e93\u7684\u540d\u79f0\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u5c06\u6362\u884c\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff1b\u5b83\u4e0d\u50cf<span class=\"application\">psql</span>\u90a3\u6837\u4f1a\u5bf9\u5206\u53f7\u8fdb\u884c\u667a\u80fd\u5904\u7406\u3002\u8981\u8ba9\u4e00\u4e2a\u547d\u4ee4\u8de8\u8d8a\u591a\u884c\uff0c\u5fc5\u987b\u5728\u9664\u6700\u540e\u4e00\u4e2a\u6362\u884c\u4e4b\u5916\u7684\u6bcf\u4e2a\u6362\u884c\u524d\u8f93\u5165\u53cd\u659c\u7ebf\u3002\u53cd\u659c\u7ebf\u548c\u7d27\u90bb\u7684\u6362\u884c\u90fd\u4f1a\u4ece\u8f93\u5165\u547d\u4ee4\u4e2d\u5220\u9664\u3002\u6ce8\u610f\uff0c\u5373\u4f7f\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u4e5f\u4f1a\u5982\u6b64\u3002</p>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u4f60\u4f7f\u7528<code class=\"option\">-j</code>\u547d\u4ee4\u884c\u5f00\u5173\uff0c\u5355\u4e2a\u6362\u884c\u5e76\u4e0d\u4f1a\u7ec8\u6b62\u547d\u4ee4\u8f93\u5165\uff1b\u53d6\u800c\u4ee3\u4e4b\u7684\u662f\u4f7f\u7528\u201c\u5206\u53f7-\u6362\u884c-\u6362\u884c\u201d\u8fd9\u4e00\u5e8f\u5217\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8f93\u5165\u4e00\u4e2a\u5206\u53f7\uff0c\u540e\u9762\u7acb\u523b\u8ddf\u7740\u4e00\u4e2a\u5b8c\u5168\u7a7a\u767d\u7684\u884c\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53cd\u659c\u7ebf-\u6362\u884c\u4e0d\u4f1a\u88ab\u7279\u6b8a\u5904\u7406\u3002\u540c\u6837\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u5e8f\u5217\u51fa\u73b0\u5728\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u6216\u6ce8\u91ca\u4e2d\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u4f1a\u6709\u7279\u6b8a\u5904\u7406\u3002</p>\n<p lang=\"zh\">\u5728\u4efb\u4e00\u79cd\u8f93\u5165\u6a21\u5f0f\u4e2d\uff0c\u5982\u679c\u4f60\u8f93\u5165\u7684\u5206\u53f7\u65e2\u4e0d\u6070\u597d\u4f4d\u4e8e\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4e4b\u524d\uff0c\u4e5f\u4e0d\u662f\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u7684\u4e00\u90e8\u5206\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u5206\u9694\u7b26\u3002\u5f53\u4f60\u8f93\u5165\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u65f6\uff0c\u5df2\u8f93\u5165\u7684\u591a\u6761\u8bed\u53e5\u4f1a\u4f5c\u4e3a\u5355\u4e2a\u4e8b\u52a1\u6267\u884c\u3002</p>\n<p lang=\"zh\">\u8981\u9000\u51fa\u4f1a\u8bdd\uff0c\u8f93\u5165<acronym class=\"acronym\">EOF</acronym>\uff08\u901a\u5e38\u662f<span class=\"keycap\"><strong>Control</strong></span>+<span class=\"keycap\"><strong>D</strong></span>\uff09\u3002\u5982\u679c\u81ea\u4e0a\u4e00\u4e2a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\u4ee5\u6765\u4f60\u5df2\u7ecf\u8f93\u5165\u4e86\u4efb\u4f55\u6587\u672c\uff0c\u90a3\u4e48<acronym class=\"acronym\">EOF</acronym>\u4f1a\u88ab\u89c6\u4e3a\u547d\u4ee4\u8f93\u5165\u7ec8\u6b62\u7b26\uff0c\u4f60\u8fd8\u9700\u8981\u518d\u8f93\u5165\u4e00\u6b21<acronym class=\"acronym\">EOF</acronym>\u624d\u80fd\u9000\u51fa\u3002</p>\n<p lang=\"zh\">\u8bf7\u6ce8\u610f\uff0c\u5355\u7528\u6237\u6a21\u5f0f\u670d\u52a1\u5668\u4e0d\u63d0\u4f9b\u590d\u6742\u7684\u884c\u7f16\u8f91\u529f\u80fd\uff08\u4f8b\u5982\u6ca1\u6709\u547d\u4ee4\u5386\u53f2\uff09\u3002\u5355\u7528\u6237\u6a21\u5f0f\u4e5f\u4e0d\u4f1a\u6267\u884c\u4efb\u4f55\u540e\u53f0\u5904\u7406\uff0c\u4f8b\u5982\u81ea\u52a8\u68c0\u67e5\u70b9\u6216\u590d\u5236\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u9ed8\u8ba4\u503c\u5728\u540e\u53f0\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u8f93\u5165\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>nohup postgres &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u7528\u6307\u5b9a\u7aef\u53e3\u542f\u52a8<code class=\"command\">postgres</code>\uff0c\u4f8b\u5982 1234\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u4f7f\u7528 psql \u8fde\u63a5\u6b64\u670d\u52a1\u5668\u65f6\uff0c\u7528 -p \u9009\u9879\u6307\u5b9a\u8be5\u7aef\u53e3\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql -p 1234</code></strong>\n</pre>\n<p lang=\"zh\">\u6216\u8005\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGPORT</code>\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>export PGPORT=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>psql</code></strong>\n</pre>\n<p lang=\"zh\">\u547d\u540d\u7684\u8fd0\u884c\u65f6\u53c2\u6570\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4efb\u4e00\u79cd\u5f62\u5f0f\u8bbe\u7f6e\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres -c work_mem=1234</code></strong>\n<code class=\"prompt\">$</code> <strong class=\"userinput\"><code>postgres --work-mem=1234</code></strong>\n</pre>\n<p lang=\"zh\">\u8fd9\u4e24\u79cd\u5f62\u5f0f\u90fd\u4f1a\u8986\u76d6 postgresql.conf \u4e2d\u53ef\u80fd\u5b58\u5728\u7684 work_mem \u8bbe\u7f6e\u3002\u6ce8\u610f\uff0c\u547d\u4ee4\u884c\u4e0a\u7684\u53c2\u6570\u540d\u53ef\u4ee5\u7528\u4e0b\u5212\u7ebf\u6216\u8fde\u5b57\u7b26\u8868\u793a\u539f\u6709\u7684\u4e0b\u5212\u7ebf\u3002\u9664\u4e86\u77ed\u671f\u8bd5\u9a8c\uff0c\u901a\u5e38\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4fee\u6539 postgresql.conf \u4e2d\u7684\u8bbe\u7f6e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u547d\u4ee4\u884c\u9009\u9879\u8bbe\u7f6e\u53c2\u6570\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.16.13\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2>\n<p><a class=\"xref\" href=\"https://pg.center/docs/18/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>, <a class=\"xref\" href=\"https://pg.center/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></a></p>\n</div>\n</div></div>", "manual_path": "app-postgres.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/app-postgres.html", "method": "same-major semantic node", "sha256": "75ddf3b029a2bc3a690fa74931c2d2b6bde45e1525c50c002df6070fce83b082", "language": "zh", "matched_nodes": ["#APP-POSTGRES/div[10]/h2[0]", "#APP-POSTGRES/div[10]/p[1]", "#APP-POSTGRES/div[10]/p[3]", "#APP-POSTGRES/div[10]/p[4]", "#APP-POSTGRES/div[10]/p[5]", "#APP-POSTGRES/div[10]/p[6]", "#APP-POSTGRES/div[10]/p[7]", "#APP-POSTGRES/div[10]/p[8]", "#APP-POSTGRES/div[11]/h2[0]", "#APP-POSTGRES/div[11]/p[1]", "#APP-POSTGRES/div[11]/p[3]", "#APP-POSTGRES/div[11]/p[7]", "#APP-POSTGRES/div[11]/p[9]", "#APP-POSTGRES/div[12]/h2[0]", "#APP-POSTGRES/div[2]/p[1]", "#APP-POSTGRES/div[3]/h2[0]", "#APP-POSTGRES/div[4]/p[1]", "#APP-POSTGRES/div[4]/p[2]", "#APP-POSTGRES/div[4]/p[3]", "#APP-POSTGRES/div[4]/p[4]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[15]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[17]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[19]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[21]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[23]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[25]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[27]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[29]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[31]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[33]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[35]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[37]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[0]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[1]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[5]/p[2]", "#APP-POSTGRES/div[5]/div[2]/div[1]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[2]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[11]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[13]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[0]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[1]/p[1]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[3]/div[2]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[3]/h3[0]", "#APP-POSTGRES/div[5]/div[3]/p[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[1]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[3]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[5]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[7]", "#APP-POSTGRES/div[5]/div[4]/div[3]/dl[0]/dd[9]", "#APP-POSTGRES/div[5]/div[4]/h3[0]", "#APP-POSTGRES/div[5]/div[4]/p[2]", "#APP-POSTGRES/div[5]/p[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[1]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[3]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[5]", "#APP-POSTGRES/div[6]/div[1]/dl[0]/dd[7]", "#APP-POSTGRES/div[6]/h2[0]", "#APP-POSTGRES/div[7]/h2[0]", "#APP-POSTGRES/div[7]/p[1]", "#APP-POSTGRES/div[7]/p[2]", "#APP-POSTGRES/div[7]/p[4]", "#APP-POSTGRES/div[7]/p[6]", "#APP-POSTGRES/div[7]/p[7]", "#APP-POSTGRES/div[8]/h2[0]", "#APP-POSTGRES/div[8]/p[1]", "#APP-POSTGRES/div[8]/p[2]", "#APP-POSTGRES/div[8]/p[3]", "#APP-POSTGRES/div[8]/p[4]", "#APP-POSTGRES/div[8]/p[5]", "#APP-POSTGRES/div[8]/p[6]", "#APP-POSTGRES/div[9]/h2[0]", "#APP-POSTGRES/div[9]/p[1]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "postgres \u2014 PostgreSQL database server", "/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": "Server 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/tables/0/rows/0/summary": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.", "/versions/18/tables/0/rows/1/summary": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.", "/versions/18/tables/0/rows/2/summary": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.", "/versions/18/tables/0/rows/3/summary": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.", "/versions/18/tables/0/rows/4/summary": "Specifies the file system location of the database configuration files. See Section 19.2 for details.", "/versions/18/tables/0/rows/5/summary": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.", "/versions/18/tables/0/rows/6/summary": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!", "/versions/18/tables/0/rows/7/summary": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.", "/versions/18/tables/0/rows/8/summary": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h .", "/versions/18/tables/0/rows/9/summary": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.", "/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": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .", "/versions/18/tables/0/rows/11/summary": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.", "/versions/18/tables/0/rows/12/summary": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .", "/versions/18/tables/0/rows/13/summary": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.", "/versions/18/tables/0/rows/14/summary": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .", "/versions/18/tables/0/rows/15/summary": "Print the postgres version and exit.", "/versions/18/tables/0/rows/16/summary": "Sets a named run-time parameter; a shorter form of -c .", "/versions/18/tables/0/rows/17/summary": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.", "/versions/18/tables/0/rows/18/summary": "Show help about postgres command line arguments, and exit.", "/versions/18/tables/0/rows/19/summary": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively.", "/versions/18/tables/0/rows/20/summary": "Allows the structure of system tables to be modified. This is used by initdb .", "/versions/18/tables/0/rows/21/summary": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.", "/versions/18/tables/0/rows/22/summary": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.", "/versions/18/tables/0/rows/23/summary": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.", "/versions/18/tables/0/rows/24/summary": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.", "/versions/18/tables/0/rows/25/summary": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.", "/versions/18/tables/0/rows/26/summary": "Selects the single-user mode. This must be the first argument on the command line.", "/versions/18/tables/0/rows/27/summary": "Echo all commands to standard output before executing them.", "/versions/18/tables/0/rows/28/summary": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.", "/versions/18/tables/0/rows/29/summary": "Send all server log output to filename . This option is only honored when supplied as a command-line option.", "/versions/18/tables/1/columns/0/label": "Variable", "/versions/18/tables/1/columns/1/label": "Meaning", "/versions/18/tables/1/rows/0/description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.", "/versions/18/tables/1/rows/1/description": "Default data directory location", "/versions/18/tables/1/rows/2/description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)", "/versions/18/tables/1/rows/3/description": "Default port number (preferably set in the configuration file)"}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "ac04c88353afb0193181ed3b85eec2b3e3e20fc3821ab0e64e32d55da4ce177a"}, "comparison_data": {"options": [{"names": ["-B nbuffers"], "signature": "-B nbuffers", "description": "Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."}, {"names": ["-c name = value"], "signature": "-c name = value", "description": "Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."}, {"names": ["-C name"], "signature": "-C name", "description": "Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view."}, {"names": ["-d debug-level"], "signature": "-d debug-level", "description": "Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."}, {"names": ["-D datadir"], "signature": "-D datadir", "description": "Specifies the file system location of the database configuration files. See Section 19.2 for details."}, {"names": ["-e"], "signature": "-e", "description": "Sets the default date style to \u201c European \u201d , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."}, {"names": ["-F"], "signature": "-F", "description": "Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"}, {"names": ["-h hostname"], "signature": "-h hostname", "description": "Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."}, {"names": ["-i"], "signature": "-i", "description": "Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly."}, {"names": ["-k directory"], "signature": "-k directory", "description": "Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."}, {"names": ["-l"], "signature": "-l", "description": "Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."}, {"names": ["-N max-connections"], "signature": "-N max-connections", "description": "Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."}, {"names": ["-p port"], "signature": "-p port", "description": "Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."}, {"names": ["-s"], "signature": "-s", "description": "Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."}, {"names": ["-S"], "signature": "-S work-mem", "description": "Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the postgres version and exit."}, {"names": ["-- name = value"], "signature": "-- name = value", "description": "Sets a named run-time parameter; a shorter form of -c ."}, {"names": ["--describe-config"], "signature": "--describe-config", "description": "This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about postgres command line arguments, and exit."}, {"names": ["-f"], "signature": "-f { s | i | o | b | t | n | m | h }", "description": "Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative."}, {"names": ["-O"], "signature": "-O", "description": "Allows the structure of system tables to be modified. This is used by initdb ."}, {"names": ["-P"], "signature": "-P", "description": "Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."}, {"names": ["-t"], "signature": "-t pa[rser] | pl[anner] | e[xecutor]", "description": "Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."}, {"names": ["-T"], "signature": "-T", "description": "This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."}, {"names": ["-v"], "signature": "-v protocol", "description": "Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."}, {"names": ["-W"], "signature": "-W seconds", "description": "A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."}, {"names": ["--single"], "signature": "--single", "description": "Selects the single-user mode. This must be the first argument on the command line."}, {"names": ["-E"], "signature": "-E", "description": "Echo all commands to standard output before executing them."}, {"names": ["-j"], "signature": "-j", "description": "Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."}, {"names": ["-r"], "signature": "-r filename", "description": "Send all server log output to filename . This option is only honored when supplied as a command-line option."}], "synopsis": ["postgres [ option ...]"], "environment": [{"name": "PGCLIENTENCODING", "description": "Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file."}, {"name": "PGDATA", "description": "Default data directory location"}, {"name": "PGDATESTYLE", "description": "Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)"}, {"name": "PGPORT", "description": "Default port number (preferably set in the configuration file)"}]}, "comparison_hash": "30509748ef5aa6efd93c214ffb28fb9023e0efecf59598655674d069faddb18d", "manual_language": "zh"}, "comparison": {"left": "12", "right": "13", "status": "changed", "diff": "--- PostgreSQL 12\n+++ PostgreSQL 13\n@@ -124,7 +124,7 @@\n       \"signature\": \"-s\"\n     },\n     {\n-      \"description\": \"Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .\",\n+      \"description\": \"Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .\",\n       \"names\": [\n         \"-S\"\n       ],"}}