{"kind": "tool", "major": "18", "item": {"slug": "pg-ctl", "name": "pg_ctl", "name_zh": "", "category": "\u670d\u52a1\u7aef\u7a0b\u5e8f", "summary": "pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668", "aliases": ["pg_ctl"], "content_hash": "29ffb27b8a245f4a87e9282497d7287fc60d400005601adf571e69a3b21be82d", "versions": {"10": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002 umask \u88ab\u8bbe\u7f6e\u4e3a 077\uff0c\u56e0\u6b64\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5176\u4ed6\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/10/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/10/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/10/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.", "signature": "-l filename --log= filename", "source_url": "/docs/10/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/10/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/10/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/10/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/10/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/10/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/10/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/10/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/10/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/10/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/10/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/10/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/10/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/10/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/10/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/10/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "10.23 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "d88723e16a11c3f2c60fbfe7d1a9ef9f6d0604e59babf639e24ced73d1fd0b14", "language": "en", "original_url": "/docs/10/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.6.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.10\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/10/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/10/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u4ee5\u53ca\u6240\u6709\u5728\u7ebf\u5907\u4efd\u7ed3\u675f\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u5e76\u4f1a\u7ec8\u6b62\u6b63\u5728\u8fdb\u884c\u7684\u5728\u7ebf\u5907\u4efd\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002<span class=\"systemitem\">umask</span>\u88ab\u8bbe\u7f6e\u4e3a 077\uff0c\u56e0\u6b64\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5176\u4ed6\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/10/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.6.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"command\">pg_ctl</code>\u4e0e\u5927\u591a\u6570\u5176\u4ed6<span class=\"productname\">PostgreSQL</span>\u5de5\u5177\u4e00\u6837\uff0c\u4e5f\u4f7f\u7528<span class=\"application\">libpq</span>\u6240\u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/10/libpq-envars.html\" title=\"33.14.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a033.14\u00a0\u8282</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/10/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.6.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre></div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre></div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre></div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">pg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.6.10\">\n<h2 lang=\"zh\">\u53c2\u89c1</h2>\n<span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span></div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/10/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "4d8110c1a8367dda055f264e37fe1809af14aa868ae8baf31f865106adaa4132", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[9]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[6]/p[4]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/10/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/10/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/10/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.", "/versions/10/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/10/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/10/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/10/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/10/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/10/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/10/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/10/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/10/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/10/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/10/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/10/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/10/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/10/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/10/tables/1/columns/0/label": "Variable", "/versions/10/tables/1/columns/1/label": "Meaning", "/versions/10/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/10/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "4ad914f4b7ec2ca5101e5cf2aed452c2b215d8b0293a9c2f797a3ae9d06d4f2d"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "bdd7be8cf41311fb924c4f72b4b5fe321c871e83c410530b40456e14200769ee", "manual_language": "zh"}, "11": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002 umask \u88ab\u8bbe\u7f6e\u4e3a 077\uff0c\u56e0\u6b64\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5176\u4ed6\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/11/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/11/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/11/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.", "signature": "-l filename --log= filename", "source_url": "/docs/11/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/11/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/11/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/11/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/11/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/11/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/11/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/11/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/11/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/11/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/11/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/11/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/11/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/11/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/11/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/11/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "11.22 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "a1a6ede46f1966be3cd3cff5b58cbd973bb3c23de994d80e89c46796199e6fa1", "language": "en", "original_url": "/docs/11/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.6.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.10\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.6.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/11/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/11/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u4ee5\u53ca\u6240\u6709\u5728\u7ebf\u5907\u4efd\u7ed3\u675f\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u5e76\u4f1a\u7ec8\u6b62\u6b63\u5728\u8fdb\u884c\u7684\u5728\u7ebf\u5907\u4efd\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002<span class=\"systemitem\">umask</span>\u88ab\u8bbe\u7f6e\u4e3a 077\uff0c\u56e0\u6b64\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5176\u4ed6\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/11/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.6.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"command\">pg_ctl</code>\u4e0e\u5927\u591a\u6570\u5176\u4ed6<span class=\"productname\">PostgreSQL</span>\u5de5\u5177\u4e00\u6837\uff0c\u4e5f\u4f7f\u7528<span class=\"application\">libpq</span>\u6240\u652f\u6301\u7684\u73af\u5883\u53d8\u91cf\uff08\u53c2\u89c1<a class=\"xref\" href=\"/docs/11/libpq-envars.html\" title=\"34.14.\u00a0\u73af\u5883\u53d8\u91cf\">\u7b2c\u00a034.14\u00a0\u8282</a>\uff09\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/11/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.6.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.6.10\">\n<h2 lang=\"zh\">\u53c2\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/11/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "592947e1e1d07d2b75419dffe1e58c324bdfb73dc950c53c734d75bc4c3baf98", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[9]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[6]/p[4]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/11/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/11/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/11/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.", "/versions/11/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/11/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/11/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/11/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/11/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/11/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/11/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/11/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/11/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/11/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/11/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/11/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/11/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/11/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/11/tables/1/columns/0/label": "Variable", "/versions/11/tables/1/columns/1/label": "Meaning", "/versions/11/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/11/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "3cd7ec4a993e08aa5c76ef1f64e1f15e3a51210e8651d8b1f4580cadaad7eb4e"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "bdd7be8cf41311fb924c4f72b4b5fe321c871e83c410530b40456e14200769ee", "manual_language": "zh"}, "12": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002 umask \u88ab\u8bbe\u7f6e\u4e3a 077\uff0c\u56e0\u6b64\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5176\u4ed6\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/12/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/12/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/12/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.", "signature": "-l filename --log= filename", "source_url": "/docs/12/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/12/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/12/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/12/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/12/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/12/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/12/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/12/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/12/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/12/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/12/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/12/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/12/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/12/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/12/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/12/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "12.22 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "0a25d6293cbf22487ae209ce7f50889b2ce03a666fe2f7cf039be0413751f7ee", "language": "en", "original_url": "/docs/12/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.7.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/12/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/12/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u4ee5\u53ca\u6240\u6709\u5728\u7ebf\u5907\u4efd\u7ed3\u675f\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u5e76\u4f1a\u7ec8\u6b62\u6b63\u5728\u8fdb\u884c\u7684\u5728\u7ebf\u5907\u4efd\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/12/logfile-maintenance.html\" title=\"24.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a024.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002<span class=\"systemitem\">umask</span>\u88ab\u8bbe\u7f6e\u4e3a 077\uff0c\u56e0\u6b64\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5176\u4ed6\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/12/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/12/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/12/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "4a31bc83c9a677a13efa4cd1c174f78f5b8e614730f31da28447cda51d6564be", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/12/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/12/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/12/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.", "/versions/12/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/12/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/12/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/12/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/12/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/12/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/12/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/12/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/12/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/12/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/12/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/12/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/12/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/12/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/12/tables/1/columns/0/label": "Variable", "/versions/12/tables/1/columns/1/label": "Meaning", "/versions/12/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/12/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "e12393d6d3d8fa92544841c05d637602ea8d79f7c45eef2a975adfa7c8cc5529"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "f5be1eb0def0d51365d25fd86e3bb235fa77663e2f180400de1c082bc7fca5d5", "manual_language": "zh"}, "13": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002 umask \u88ab\u8bbe\u7f6e\u4e3a 077\uff0c\u56e0\u6b64\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5176\u4ed6\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/13/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/13/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/13/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.", "signature": "-l filename --log= filename", "source_url": "/docs/13/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/13/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/13/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/13/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/13/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/13/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/13/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/13/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/13/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/13/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/13/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/13/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/13/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/13/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/13/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/13/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "13.23 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "cf833e187a2a35f6e170f3fa67a0577665b178d0a2be7f8d2817191d7beae8f0", "language": "en", "original_url": "/docs/13/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.7.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/13/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/13/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\">initdb</span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u4ee5\u53ca\u6240\u6709\u5728\u7ebf\u5907\u4efd\u7ed3\u675f\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u5e76\u4f1a\u7ec8\u6b62\u6b63\u5728\u8fdb\u884c\u7684\u5728\u7ebf\u5907\u4efd\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/13/logfile-maintenance.html\" title=\"24.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a024.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002<span class=\"systemitem\">umask</span>\u88ab\u8bbe\u7f6e\u4e3a 077\uff0c\u56e0\u6b64\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5176\u4ed6\u7528\u6237\u65e0\u6cd5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/13/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/13/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/13/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "9af5daa903d5d3a985926f4461232f426de38c181050ab1ed05ac6cbb4975dd3", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/13/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/13/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/13/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.", "/versions/13/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/13/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/13/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/13/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/13/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/13/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/13/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/13/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/13/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/13/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/13/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/13/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/13/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/13/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/13/tables/1/columns/0/label": "Variable", "/versions/13/tables/1/columns/1/label": "Meaning", "/versions/13/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/13/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "3e61ae99515541d1a1bdd6f6a92ea2f88011842834148bfd2b209a36714e220d"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "f5be1eb0def0d51365d25fd86e3bb235fa77663e2f180400de1c082bc7fca5d5", "manual_language": "zh"}, "14": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/14/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/14/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/14/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "signature": "-l filename --log= filename", "source_url": "/docs/14/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/14/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/14/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/14/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/14/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/14/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/14/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/14/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/14/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/14/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/14/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/14/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/14/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/14/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/14/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/14/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "14.24 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "719eb9adfe76c94dbeb3061bfb6f26283d31d560dcb22decef5f9a7bb19a8983", "language": "en", "original_url": "/docs/14/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.7.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/14/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/14/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u4ee5\u53ca\u6240\u6709\u5728\u7ebf\u5907\u4efd\u7ed3\u675f\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\uff0c\u5e76\u4f1a\u7ec8\u6b62\u6b63\u5728\u8fdb\u884c\u7684\u5728\u7ebf\u5907\u4efd\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/14/logfile-maintenance.html\" title=\"25.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a025.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/14/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/14/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/14/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "dfa182faeb904e9dd22ce5c698c5456dd8e514cd367e063e46d580ba517ae5f8", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/14/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/14/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/14/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "/versions/14/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/14/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/14/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/14/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/14/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/14/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/14/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/14/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/14/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/14/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/14/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/14/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/14/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/14/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/14/tables/1/columns/0/label": "Variable", "/versions/14/tables/1/columns/1/label": "Meaning", "/versions/14/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/14/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "49ab3a88988a180e275121155222a2de883fc855a6211d3f802319317b133034"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53", "manual_language": "zh"}, "15": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/15/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/15/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/15/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "signature": "-l filename --log= filename", "source_url": "/docs/15/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/15/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/15/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/15/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/15/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/15/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/15/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/15/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/15/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/15/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/15/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/15/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/15/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/15/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/15/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/15/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "15.19 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "06c880a0deff33cf232f150015f267db49d206e5283ec704937bc1f9ef5ed7af", "language": "en", "original_url": "/docs/15/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.7.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/15/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/15/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/15/logfile-maintenance.html\" title=\"25.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a025.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/15/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/15/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/15/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "8c498b2b6016e27d18beab86688228216638bff0fadb1aa4668b312d0d55a60c", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/15/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/15/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/15/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "/versions/15/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/15/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/15/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/15/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/15/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/15/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/15/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/15/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/15/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/15/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/15/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/15/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/15/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/15/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/15/tables/1/columns/0/label": "Variable", "/versions/15/tables/1/columns/1/label": "Meaning", "/versions/15/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/15/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "cad3202bd158920103f11efa58306cd4eac200b46fffc62369d8337600da7488"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53", "manual_language": "zh"}, "16": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/16/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/16/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/16/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "signature": "-l filename --log= filename", "source_url": "/docs/16/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/16/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/16/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/16/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/16/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/16/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/16/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/16/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/16/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/16/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/16/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/16/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/16/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/16/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/16/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/16/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "16.15 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "ef2eb74085a1387ed216a22daf82419978388261da34d3046498b4c19f6105b2", "language": "en", "original_url": "/docs/16/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.7.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.7.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/16/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/16/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/16/logfile-maintenance.html\" title=\"25.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a025.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/16/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/16/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.7.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/16/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "743b3639e7a12112e5562c63c8e17f16c8f3cf2fa33c7bf651944dd08920c10e", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/16/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/16/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/16/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "/versions/16/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/16/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/16/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/16/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/16/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/16/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/16/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/16/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/16/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/16/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/16/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/16/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/16/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/16/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/16/tables/1/columns/0/label": "Variable", "/versions/16/tables/1/columns/1/label": "Meaning", "/versions/16/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/16/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "4a0b23980ad6568428c15c59f782fca5ea767c43ae84e9924b294927973304ca"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53", "manual_language": "zh"}, "17": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/17/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/17/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/17/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "signature": "-l filename --log= filename", "source_url": "/docs/17/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/17/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/17/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/17/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/17/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/17/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/17/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/17/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/17/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/17/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/17/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/17/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/17/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/17/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/17/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/17/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "17.11 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "7c02a0fadd45ab6bd22afdbb85d9cb316e90e09c15f218899dafa55f611361eb", "language": "en", "original_url": "/docs/17/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.8.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/17/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/17/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/17/logfile-maintenance.html\" title=\"24.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a024.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/17/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/17/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/17/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "3fc273913c083f99b87ec411b46d4c1b55853dd1a73bcc0bb2a1c2d190927ecb", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/17/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/17/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/17/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "/versions/17/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/17/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/17/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/17/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/17/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/17/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/17/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/17/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/17/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/17/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/17/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/17/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/17/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/17/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/17/tables/1/columns/0/label": "Variable", "/versions/17/tables/1/columns/1/label": "Meaning", "/versions/17/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/17/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "e3b7d73a6dd7bea2d5760d73f879eddc230d538c8ab2f5380fff64fe095747d1"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53", "manual_language": "zh"}, "18": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/18/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "signature": "-l filename --log= filename", "source_url": "/docs/18/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/18/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/18/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/18/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/18/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/18/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/18/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/18/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/18/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "18.6 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "bf10289e73df34e48912e8612d5df29f8a8145a2250627d8c099ed59eae23339", "language": "en", "original_url": "/docs/18/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.8.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/logfile-maintenance.html\" title=\"24.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a024.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/18/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "0c57a8d446a7fcb6f1d74816702835d7f69efa2ae491f801520c5a12b219567b", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/18/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/18/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "/versions/18/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/18/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/18/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/18/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/18/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/18/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/18/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/18/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/18/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/18/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/18/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/18/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/18/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/18/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/18/tables/1/columns/0/label": "Variable", "/versions/18/tables/1/columns/1/label": "Meaning", "/versions/18/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/18/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "a73c131294fda805a1d49a5a28057f64eb9a0f413c84413b7fd6e649544ea84a"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53", "manual_language": "zh"}, "19": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/19/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/19/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/19/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "signature": "-l filename --log= filename", "source_url": "/docs/19/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/19/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/19/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/19/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/19/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/19/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/19/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/19/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/19/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/19/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/19/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/19/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/19/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/19/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/19/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/19/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "19beta4 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "742d34481524110847b1ade573650621ce4b12b1c8d05818145b4fbdc94d8188", "language": "en", "original_url": "/docs/19/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.8.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/19/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/19/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/19/logfile-maintenance.html\" title=\"24.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a024.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/19/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/19/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/19/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "b57ff06cdeac7759147294d59fc484c3873fa4082c554e23e5154dac81625a07", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/19/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/19/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/19/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "/versions/19/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/19/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/19/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/19/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/19/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/19/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/19/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/19/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/19/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/19/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/19/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/19/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/19/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/19/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/19/tables/1/columns/0/label": "Variable", "/versions/19/tables/1/columns/1/label": "Meaning", "/versions/19/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/19/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "ac78cf0f527c732df6779a750766df8a6517c83d0614edd8d2364f5929aa89d4"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53", "manual_language": "zh"}, "20": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/devel/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "signature": "-l filename --log= filename", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/devel/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/devel/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "20devel English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "06ed3d8c295297d0ef293c8cbf7723637bfa791b7c1a5e5186687975e1d2da4b", "language": "en", "original_url": "/docs/devel/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.8.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/devel/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/devel/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/devel/logfile-maintenance.html\" title=\"24.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a024.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/devel/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/devel/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/devel/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "e0b0d16bca54678b258b4cc24f2c5c604f59922f1a38794180c4809902ce7b5d", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/summary": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL server", "/category": "Server applications", "/versions/20/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/20/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/20/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "/versions/20/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/20/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/20/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/20/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/20/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/20/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/20/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/20/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/20/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/20/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/20/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/20/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/20/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/20/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/20/tables/1/columns/0/label": "Variable", "/versions/20/tables/1/columns/1/label": "Meaning", "/versions/20/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/20/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "9273bc5b4e36852abbf687e6142efffc8c0aed936cc26958a65fd6ee92ff1e15"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53", "manual_language": "zh"}}}, "snapshot": {"facts": [{"label": "\u624b\u518c\u4e2d\u7684\u53ef\u6267\u884c\u7a0b\u5e8f", "value": "pg_ctl"}, {"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": "18"}], "tables": [{"key": "options", "rows": [{"summary": "\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-c --core-files"}}, {"summary": "\u6307\u5b9a\u6570\u636e\u5e93\u914d\u7f6e\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf PGDATA \u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-D datadir --pgdata= datadir"}}, {"summary": "\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230 filename \u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-l filename --log= filename"}}, {"summary": "\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002 mode \u53ef\u4ee5\u662f smart \u3001 fast \u6216 immediate \uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a fast \u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-m mode --mode= mode"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 postgres \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-o options --options= options"}}, {"summary": "\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9 initdb \u547d\u4ee4\u7684\u9009\u9879\u3002 -o \u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-o initdb-options --options= initdb-options"}}, {"summary": "\u6307\u5b9a postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e pg_ctl \u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230 postgres \u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-p path"}}, {"summary": "\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-s --silent"}}, {"summary": "\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879 -w \uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf PGCTLTIMEOUT \u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-t seconds --timeout= seconds"}}, {"summary": "\u6253\u5370 pg_ctl \u7684\u7248\u672c\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-V --version"}}, {"summary": "\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002 start \u3001 stop \u3001 restart \u3001 promote \u548c register \u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-w --wait"}}, {"summary": "\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879 -w \u76f8\u53cd\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-W --no-wait"}}, {"summary": "\u663e\u793a\u6709\u5173 pg_ctl \u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-? --help"}}, {"summary": "\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c pg_ctl \u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531 pg_ctl \u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176 event_source \u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0 PostgreSQL \u8bb0\u5f55\u65e5\u5fd7\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-e source"}}, {"summary": "\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a PostgreSQL \u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-N servicename"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-P password"}}, {"summary": "\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002 start-type \u53ef\u4ee5\u662f auto \u3001 demand \uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a auto \u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-S start-type"}}, {"summary": "\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528 DOMAIN\\username \u683c\u5f0f\u3002", "signature": {"url": "/docs/18/app-pg-ctl.html", "text": "-U username"}}], "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": "PGCTLTIMEOUT", "description": "\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\u3002"}, {"name": "PGDATA", "description": "\u9ed8\u8ba4\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\u3002"}], "title": "\u73af\u5883\u53d8\u91cf", "columns": [{"key": "name", "label": "\u53d8\u91cf"}, {"key": "description", "label": "\u542b\u4e49"}]}], "options": [{"names": ["-c", "--core-files"], "summary": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "signature": "-c --core-files", "source_url": "/docs/18/app-pg-ctl.html", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "signature": "-D datadir --pgdata= datadir", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "signature": "-l filename --log= filename", "source_url": "/docs/18/app-pg-ctl.html", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "signature": "-m mode --mode= mode", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o options --options= options", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "signature": "-o initdb-options --options= initdb-options", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "signature": "-p path", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "summary": "Print only errors, no informational messages.", "signature": "-s --silent", "source_url": "/docs/18/app-pg-ctl.html", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "signature": "-t seconds --timeout= seconds", "source_url": "/docs/18/app-pg-ctl.html", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "summary": "Print the pg_ctl version and exit.", "signature": "-V --version", "source_url": "/docs/18/app-pg-ctl.html", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "summary": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "signature": "-w --wait", "source_url": "/docs/18/app-pg-ctl.html", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "signature": "-W --no-wait", "source_url": "/docs/18/app-pg-ctl.html", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "summary": "Show help about pg_ctl command line arguments, and exit.", "signature": "-? --help", "source_url": "/docs/18/app-pg-ctl.html", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "signature": "-e source", "source_url": "/docs/18/app-pg-ctl.html", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "signature": "-N servicename", "source_url": "/docs/18/app-pg-ctl.html", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "summary": "Password for the user to run the service as.", "signature": "-P password", "source_url": "/docs/18/app-pg-ctl.html", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "signature": "-S start-type", "source_url": "/docs/18/app-pg-ctl.html", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "signature": "-U username", "source_url": "/docs/18/app-pg-ctl.html", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "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-pg-ctl.html", "file": "app-pg-ctl.html", "label": "18.6 English manual \u00b7 app-pg-ctl.html", "anchor": "", "sha256": "bf10289e73df34e48912e8612d5df29f8a8145a2250627d8c099ed59eae23339", "language": "en", "original_url": "/docs/18/app-pg-ctl.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": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "signature": "pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]\npg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]\npg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]\npg_ctl reload [ -D datadir ] [ -s ]\npg_ctl status [ -D datadir ]\npg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]\npg_ctl logrotate [ -D datadir ] [ -s ]\npg_ctl kill signal_name process_id\npg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]\npg_ctl unregister [ -N servicename ]", "description": ["pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236 PostgreSQL \u670d\u52a1\u5668"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}], "manual_html": "<div><div class=\"refentry\" id=\"APP-PG-CTL\">\n<div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\"><span class=\"application\">pg_ctl</span></span></h2>\n<p lang=\"zh\">pg_ctl \u2014 \u521d\u59cb\u5316\u3001\u542f\u52a8\u3001\u505c\u6b62\u6216\u63a7\u5236<span class=\"productname\">PostgreSQL</span>\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.8.4.1\"><code class=\"command\">pg_ctl</code> <code class=\"option\">init[db]</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>initdb-options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.2\"><code class=\"command\">pg_ctl</code> <code class=\"option\">start</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-l</code> <em class=\"replaceable\"><code>filename</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-p</code> <em class=\"replaceable\"><code>path</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.3\"><code class=\"command\">pg_ctl</code> <code class=\"option\">stop</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.4\"><code class=\"command\">pg_ctl</code> <code class=\"option\">restart</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-m</code> <code class=\"option\">s[mart]</code> | <code class=\"option\">f[ast]</code> | <code class=\"option\">i[mmediate]</code> ] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>] [<code class=\"option\">-c</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.5\"><code class=\"command\">pg_ctl</code> <code class=\"option\">reload</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.6\"><code class=\"command\">pg_ctl</code> <code class=\"option\">status</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.7\"><code class=\"command\">pg_ctl</code> <code class=\"option\">promote</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.8\"><code class=\"command\">pg_ctl</code> <code class=\"option\">logrotate</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-s</code>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.9\"><code class=\"command\">pg_ctl</code> <code class=\"option\">kill</code> <em class=\"replaceable\"><code>signal_name</code></em> <em class=\"replaceable\"><code>process_id</code></em></p>\n</div>\n<p lang=\"zh\">\u5728 Microsoft Windows \u4e0a\uff0c\u8fd8\u652f\u6301\uff1a</p>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.11\"><code class=\"command\">pg_ctl</code> <code class=\"option\">register</code> [<code class=\"option\">-D</code> <em class=\"replaceable\"><code>datadir</code></em>] [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>] [<code class=\"option\">-U</code> <em class=\"replaceable\"><code>username</code></em>] [<code class=\"option\">-P</code> <em class=\"replaceable\"><code>password</code></em>] [<code class=\"option\">-S</code> <code class=\"option\">a[uto]</code> | <code class=\"option\">d[emand]</code> ] [<code class=\"option\">-e</code> <em class=\"replaceable\"><code>source</code></em>] [<code class=\"option\">-W</code>] [<code class=\"option\">-t</code> <em class=\"replaceable\"><code>seconds</code></em>] [<code class=\"option\">-s</code>] [<code class=\"option\">-o</code> <em class=\"replaceable\"><code>options</code></em>]</p>\n</div>\n<div class=\"cmdsynopsis\">\n<p id=\"id-1.9.5.8.4.12\"><code class=\"command\">pg_ctl</code> <code class=\"option\">unregister</code> [<code class=\"option\">-N</code> <em class=\"replaceable\"><code>servicename</code></em>]</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\">\n<h2 lang=\"zh\">\u8bf4\u660e</h2>\n<p lang=\"zh\"><span class=\"application\">pg_ctl</span>\u662f\u4e00\u4e2a\u5b9e\u7528\u5de5\u5177\uff0c\u7528\u4e8e\u521d\u59cb\u5316<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u542f\u52a8\u3001\u505c\u6b62\u6216\u91cd\u542f<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u670d\u52a1\u5668\uff08<a class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\uff09\uff0c\u6216\u8005\u663e\u793a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u5668\u7684\u72b6\u6001\u3002\u867d\u7136\u670d\u52a1\u5668\u4e5f\u53ef\u4ee5\u624b\u5de5\u542f\u52a8\uff0c\u4f46<span class=\"application\">pg_ctl</span>\u5c06\u91cd\u5b9a\u5411\u65e5\u5fd7\u8f93\u51fa\u3001\u6b63\u786e\u5730\u4e0e\u7ec8\u7aef\u548c\u8fdb\u7a0b\u7ec4\u8131\u79bb\u7b49\u4efb\u52a1\u5c01\u88c5\u4e86\u8d77\u6765\u3002\u5b83\u8fd8\u63d0\u4f9b\u4e86\u4fbf\u4e8e\u5b9e\u65bd\u53d7\u63a7\u5173\u95ed\u7684\u9009\u9879\u3002</p>\n<p lang=\"zh\"><code class=\"option\">init</code>\u6216<code class=\"option\">initdb</code>\u6a21\u5f0f\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684<span class=\"productname\">PostgreSQL</span>\u6570\u636e\u5e93\u96c6\u7c07\uff0c\u4e5f\u5c31\u662f\u7531\u5355\u4e2a\u670d\u52a1\u5668\u5b9e\u4f8b\u7ba1\u7406\u7684\u4e00\u7ec4\u6570\u636e\u5e93\u3002\u8be5\u6a21\u5f0f\u4f1a\u8c03\u7528<code class=\"command\">initdb</code>\u547d\u4ee4\u3002\u8be6\u89c1<a class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"><span class=\"refentrytitle\"><span class=\"application\">initdb</span></span></a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">start</code>\u6a21\u5f0f\u4f1a\u542f\u52a8\u4e00\u4e2a\u65b0\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5728\u540e\u53f0\u542f\u52a8\uff0c\u5176\u6807\u51c6\u8f93\u5165\u8fde\u63a5\u5230<code class=\"filename\">/dev/null</code>\uff08\u5728 Windows \u4e0a\u5219\u662f<code class=\"literal\">nul</code>\uff09\u3002\u5728\u7c7b Unix \u7cfb\u7edf\u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\uff08\u800c\u4e0d\u662f\u6807\u51c6\u9519\u8bef\uff09\u3002\u56e0\u6b64\uff0c<span class=\"application\">pg_ctl</span>\u7684\u6807\u51c6\u8f93\u51fa\u5e94\u88ab\u91cd\u5b9a\u5411\u5230\u6587\u4ef6\uff0c\u6216\u8005\u901a\u8fc7\u7ba1\u9053\u4f20\u7ed9\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f8b\u5982<span class=\"application\">rotatelogs</span>\u8fd9\u6837\u7684\u65e5\u5fd7\u8f6e\u8f6c\u7a0b\u5e8f\uff1b\u5426\u5219<code class=\"command\">postgres</code>\u4f1a\u5728\u540e\u53f0\u5c06\u5176\u8f93\u51fa\u5199\u5165\u63a7\u5236\u7ec8\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8131\u79bb shell \u7684\u8fdb\u7a0b\u7ec4\u3002\u5728 Windows \u4e0a\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u670d\u52a1\u5668\u7684\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u4f1a\u88ab\u53d1\u9001\u5230\u7ec8\u7aef\u3002\u4f7f\u7528<code class=\"option\">-l</code>\u5c06\u670d\u52a1\u5668\u8f93\u51fa\u8ffd\u52a0\u5230\u65e5\u5fd7\u6587\u4ef6\uff0c\u53ef\u4ee5\u6539\u53d8\u8fd9\u4e9b\u9ed8\u8ba4\u884c\u4e3a\u3002\u5efa\u8bae\u4f7f\u7528<code class=\"option\">-l</code>\u6216\u8f93\u51fa\u91cd\u5b9a\u5411\u3002</p>\n<p lang=\"zh\"><code class=\"option\">stop</code>\u6a21\u5f0f\u4f1a\u5173\u95ed\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u670d\u52a1\u5668\u3002\u53ef\u4ee5\u4f7f\u7528<code class=\"option\">-m</code>\u9009\u9879\u9009\u62e9\u4e09\u79cd\u4e0d\u540c\u7684\u5173\u95ed\u65b9\u6cd5\u3002<span class=\"quote\">\u201c<span class=\"quote\">Smart</span>\u201d</span>\u6a21\u5f0f\u4e0d\u5141\u8bb8\u65b0\u8fde\u63a5\uff0c\u7136\u540e\u7b49\u5f85\u6240\u6709\u73b0\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u70ed\u5907\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u6240\u6709\u5ba2\u6237\u7aef\u65ad\u5f00\u540e\uff0c\u6062\u590d\u548c\u6d41\u590d\u5236\u90fd\u4f1a\u7ec8\u6b62\u3002<span class=\"quote\">\u201c<span class=\"quote\">Fast</span>\u201d</span>\u6a21\u5f0f\uff08\u9ed8\u8ba4\u503c\uff09\u4e0d\u7b49\u5f85\u5ba2\u6237\u7aef\u65ad\u5f00\u3002\u6240\u6709\u6d3b\u52a8\u4e8b\u52a1\u90fd\u4f1a\u56de\u6eda\uff0c\u5ba2\u6237\u7aef\u4f1a\u88ab\u5f3a\u5236\u65ad\u5f00\uff0c\u7136\u540e\u670d\u52a1\u5668\u5173\u95ed\u3002<span class=\"quote\">\u201c<span class=\"quote\">Immediate</span>\u201d</span>\u6a21\u5f0f\u4f1a\u7acb\u5373\u4e2d\u6b62\u6240\u6709\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u800c\u4e0d\u6267\u884c\u5e72\u51c0\u5173\u95ed\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u670d\u52a1\u5668\u5728\u4e0b\u6b21\u542f\u52a8\u65f6\u8fdb\u5165\u4e00\u6b21\u5d29\u6e83\u6062\u590d\u5468\u671f\u3002</p>\n<p lang=\"zh\"><code class=\"option\">restart</code>\u6a21\u5f0f\u5b9e\u9645\u4e0a\u5c31\u662f\u5148\u6267\u884c\u505c\u6b62\u518d\u6267\u884c\u542f\u52a8\u3002\u8fd9\u4f7f\u5f97\u53ef\u4ee5\u4fee\u6539<code class=\"command\">postgres</code>\u7684\u547d\u4ee4\u884c\u9009\u9879\uff0c\u6216\u8005\u4fee\u6539\u90a3\u4e9b\u4e0d\u91cd\u542f\u670d\u52a1\u5668\u5c31\u65e0\u6cd5\u66f4\u6539\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u542f\u52a8\u65f6\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4e86\u76f8\u5bf9\u8def\u5f84\uff0c\u90a3\u4e48\u9664\u975e\u5728\u4e0e\u670d\u52a1\u5668\u4e0a\u6b21\u542f\u52a8\u65f6\u76f8\u540c\u7684\u5f53\u524d\u76ee\u5f55\u4e2d\u6267\u884c<span class=\"application\">pg_ctl</span>\uff0c\u5426\u5219<code class=\"option\">restart</code>\u53ef\u80fd\u5931\u8d25\u3002</p>\n<p lang=\"zh\"><code class=\"option\">reload</code>\u6a21\u5f0f\u53ea\u662f\u5411<code class=\"command\">postgres</code>\u670d\u52a1\u5668\u8fdb\u7a0b\u53d1\u9001\u4e00\u4e2a<span class=\"systemitem\">SIGHUP</span>\u4fe1\u53f7\uff0c\u4f7f\u5176\u91cd\u65b0\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff08<code class=\"filename\">postgresql.conf</code>\u3001<code class=\"filename\">pg_hba.conf</code>\u7b49\uff09\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4fee\u6539\u90a3\u4e9b\u65e0\u9700\u5b8c\u5168\u91cd\u542f\u670d\u52a1\u5668\u5373\u53ef\u751f\u6548\u7684\u914d\u7f6e\u6587\u4ef6\u9009\u9879\u3002</p>\n<p lang=\"zh\">status \u6a21\u5f0f\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u5728\u4f7f\u7528\u6307\u5b9a\u7684\u6570\u636e\u76ee\u5f55\u8fd0\u884c\u3002\u5982\u679c\u6b63\u5728\u8fd0\u884c\uff0c\u4f1a\u663e\u793a\u670d\u52a1\u5668\u7684 PID \u548c\u542f\u52a8\u65f6\u4f7f\u7528\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u5982\u679c\u670d\u52a1\u5668\u672a\u8fd0\u884c\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 3\u3002\u5982\u679c\u672a\u6307\u5b9a\u53ef\u8bbf\u95ee\u7684\u6570\u636e\u76ee\u5f55\uff0cpg_ctl \u8fd4\u56de\u9000\u51fa\u72b6\u6001 4\u3002</p>\n<p lang=\"zh\"><code class=\"option\">promote</code>\u6a21\u5f0f\u4f1a\u6307\u793a\u5728\u6307\u5b9a\u6570\u636e\u76ee\u5f55\u4e2d\u8fd0\u884c\u7684\u5907\u5e93\u7ed3\u675f\u5907\u5e93\u6a21\u5f0f\uff0c\u5e76\u5f00\u59cb\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u3002</p>\n<p lang=\"zh\"><code class=\"option\">logrotate</code>\u6a21\u5f0f\u8f6e\u6362\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u3002\u6709\u5173\u5982\u4f55\u5c06\u6b64\u6a21\u5f0f\u4e0e\u5916\u90e8\u65e5\u5fd7\u8f6e\u6362\u5de5\u5177\u4e00\u8d77\u4f7f\u7528\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u53c2\u89c1<a class=\"xref\" href=\"/docs/18/logfile-maintenance.html\" title=\"24.3.\u00a0\u65e5\u5fd7\u6587\u4ef6\u7ef4\u62a4\">\u7b2c\u00a024.3\u00a0\u8282</a>\u3002</p>\n<p lang=\"zh\"><code class=\"option\">kill</code>\u6a21\u5f0f\u5411\u6307\u5b9a\u8fdb\u7a0b\u53d1\u9001\u4fe1\u53f7\u3002\u8fd9\u5728\u6ca1\u6709\u5185\u7f6e<span class=\"application\">kill</span>\u547d\u4ee4\u7684<span class=\"productname\">Microsoft Windows</span>\u4e0a\u5c24\u5176\u6709\u7528\u3002\u4f7f\u7528<code class=\"literal\">--help</code>\u53ef\u67e5\u770b\u53d7\u652f\u6301\u7684\u4fe1\u53f7\u540d\u79f0\u5217\u8868\u3002</p>\n<p lang=\"zh\"><code class=\"option\">register</code>\u6a21\u5f0f\u4f1a\u5c06<span class=\"productname\">PostgreSQL</span>\u670d\u52a1\u5668\u6ce8\u518c\u4e3a<span class=\"productname\">Microsoft Windows</span>\u4e0a\u7684\u7cfb\u7edf\u670d\u52a1\u3002<code class=\"option\">-S</code>\u9009\u9879\u5141\u8bb8\u9009\u62e9\u670d\u52a1\u542f\u52a8\u7c7b\u578b\uff0c\u53ef\u4ee5\u662f<span class=\"quote\">\u201c<span class=\"quote\">auto</span>\u201d</span>\uff08\u7cfb\u7edf\u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8\u670d\u52a1\uff09\u6216<span class=\"quote\">\u201c<span class=\"quote\">demand</span>\u201d</span>\uff08\u6309\u9700\u542f\u52a8\u670d\u52a1\uff09\u3002</p>\n<p lang=\"zh\"><code class=\"option\">unregister</code>\u6a21\u5f0f\u4f1a\u5728<span class=\"productname\">Microsoft Windows</span>\u4e0a\u6ce8\u9500\u4e00\u4e2a\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u4f1a\u64a4\u9500<code class=\"option\">register</code>\u547d\u4ee4\u7684\u6548\u679c\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\">\n<h2 lang=\"zh\">\u9009\u9879</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-c</code><br/></span><span class=\"term\"><code class=\"option\">--core-files</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5728\u652f\u6301\u7684\u5e73\u53f0\u4e0a\uff0c\u901a\u8fc7\u89e3\u9664\u5bf9\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u65bd\u52a0\u7684\u4efb\u4f55\u8f6f\u8d44\u6e90\u9650\u5236\uff0c\u5c1d\u8bd5\u5141\u8bb8\u670d\u52a1\u5668\u5728\u5d29\u6e83\u65f6\u751f\u6210\u6838\u5fc3\u8f6c\u50a8\u6587\u4ef6\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u4ece\u5931\u8d25\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u4e2d\u83b7\u5f97\u6808\u8ddf\u8e2a\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u8c03\u8bd5\u6216\u8bca\u65ad\u95ee\u9898\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-D <em class=\"replaceable\"><code>datadir</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--pgdata=<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\u6240\u5728\u7684\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u4f7f\u7528\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGDATA</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-l <em class=\"replaceable\"><code>filename</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--log=<em class=\"replaceable\"><code>filename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5c06\u670d\u52a1\u5668\u65e5\u5fd7\u8f93\u51fa\u8ffd\u52a0\u5230<em class=\"replaceable\"><code>filename</code></em>\u3002\u5982\u679c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c31\u4f1a\u521b\u5efa\u5b83\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u6709\u96c6\u7c07\u62e5\u6709\u8005\u53ef\u4ee5\u8bbf\u95ee\u8be5\u65e5\u5fd7\u6587\u4ef6\u3002\u5982\u679c\u5728\u96c6\u7c07\u4e2d\u542f\u7528\u4e86\u7ec4\u8bbf\u95ee\u6743\u9650\uff0c\u4e0e\u96c6\u7c07\u62e5\u6709\u8005\u540c\u7ec4\u7684\u7528\u6237\u4e5f\u53ef\u4ee5\u8bfb\u53d6\u5b83\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-m <em class=\"replaceable\"><code>mode</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--mode=<em class=\"replaceable\"><code>mode</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u5173\u95ed\u6a21\u5f0f\u3002<em class=\"replaceable\"><code>mode</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">smart</code>\u3001<code class=\"literal\">fast</code>\u6216<code class=\"literal\">immediate</code>\uff0c\u4e5f\u53ef\u4ee5\u662f\u8fd9\u4e09\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">fast</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">postgres</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-o <em class=\"replaceable\"><code>initdb-options</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--options=<em class=\"replaceable\"><code>initdb-options</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a\u8981\u76f4\u63a5\u4f20\u9012\u7ed9<code class=\"command\">initdb</code>\u547d\u4ee4\u7684\u9009\u9879\u3002<code class=\"option\">-o</code>\u53ef\u4ee5\u6307\u5b9a\u591a\u6b21\uff0c\u7ed9\u51fa\u7684\u6240\u6709\u9009\u9879\u90fd\u4f1a\u88ab\u4f20\u9012\u8fc7\u53bb\u3002</p>\n<p lang=\"zh\">\u901a\u5e38\u5e94\u5c06<em class=\"replaceable\"><code>initdb-options</code></em>\u653e\u5728\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u4e2d\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u88ab\u4f20\u9012\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-p <em class=\"replaceable\"><code>path</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\u6307\u5b9a<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u53d6\u81ea\u4e0e<code class=\"command\">pg_ctl</code>\u76f8\u540c\u7684\u76ee\u5f55\uff1b\u5982\u679c\u90a3\u91cc\u6ca1\u6709\uff0c\u5219\u53d6\u81ea\u786c\u7f16\u7801\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u9664\u975e\u91c7\u7528\u4e86\u67d0\u4e9b\u975e\u5e38\u89c4\u65b9\u5f0f\uff0c\u5e76\u6536\u5230\u627e\u4e0d\u5230<code class=\"filename\">postgres</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u9519\u8bef\uff0c\u5426\u5219\u901a\u5e38\u4e0d\u9700\u8981\u4f7f\u7528\u6b64\u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5728<code class=\"literal\">init</code>\u6a21\u5f0f\u4e2d\uff0c\u6b64\u9009\u9879\u540c\u6837\u6307\u5b9a<code class=\"filename\">initdb</code>\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u4f4d\u7f6e\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-s</code><br/></span><span class=\"term\"><code class=\"option\">--silent</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u53ea\u6253\u5370\u9519\u8bef\uff0c\u4e0d\u6253\u5370\u4fe1\u606f\u6027\u6d88\u606f\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-t <em class=\"replaceable\"><code>seconds</code></em></code><br/></span><span class=\"term\"><code class=\"option\">--timeout=<em class=\"replaceable\"><code>seconds</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u7b49\u5f85\u67d0\u4e2a\u64cd\u4f5c\u5b8c\u6210\u65f6\u6700\u591a\u7b49\u5f85\u591a\u5c11\u79d2\uff08\u89c1\u9009\u9879<code class=\"option\">-w</code>\uff09\u3002\u9ed8\u8ba4\u503c\u4e3a\u73af\u5883\u53d8\u91cf<code class=\"envar\">PGCTLTIMEOUT</code>\u7684\u503c\uff1b\u5982\u679c\u672a\u8bbe\u7f6e\u8be5\u73af\u5883\u53d8\u91cf\uff0c\u5219\u9ed8\u8ba4\u4e3a 60 \u79d2\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-V</code><br/></span><span class=\"term\"><code class=\"option\">--version</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6253\u5370<span class=\"application\">pg_ctl</span>\u7684\u7248\u672c\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-w</code><br/></span><span class=\"term\"><code class=\"option\">--wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002<code class=\"literal\">start</code>\u3001<code class=\"literal\">stop</code>\u3001<code class=\"literal\">restart</code>\u3001<code class=\"literal\">promote</code>\u548c<code class=\"literal\">register</code>\u6a21\u5f0f\u652f\u6301\u6b64\u9009\u9879\uff0c\u800c\u4e14\u5bf9\u8fd9\u4e9b\u6a21\u5f0f\u6765\u8bf4\u5b83\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</p>\n<p lang=\"zh\">\u5728\u7b49\u5f85\u671f\u95f4\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u53cd\u590d\u68c0\u67e5\u670d\u52a1\u5668\u7684<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\uff0c\u5e76\u5728\u4e24\u6b21\u68c0\u67e5\u4e4b\u95f4\u77ed\u6682\u4f11\u7720\u3002\u5f53<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u8868\u660e\u670d\u52a1\u5668\u5df2\u51c6\u5907\u597d\u63a5\u53d7\u8fde\u63a5\u65f6\uff0c\u542f\u52a8\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002\u5f53\u670d\u52a1\u5668\u79fb\u9664<acronym class=\"acronym\">PID</acronym>\u6587\u4ef6\u65f6\uff0c\u5173\u95ed\u5c31\u88ab\u89c6\u4e3a\u5b8c\u6210\u3002<code class=\"command\">pg_ctl</code>\u4f1a\u6839\u636e\u542f\u52a8\u6216\u5173\u95ed\u662f\u5426\u6210\u529f\u8fd4\u56de\u76f8\u5e94\u7684\u9000\u51fa\u4ee3\u7801\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u64cd\u4f5c\u672a\u80fd\u5728\u8d85\u65f6\u65f6\u95f4\u5185\u5b8c\u6210\uff08\u89c1\u9009\u9879<code class=\"option\">-t</code>\uff09\uff0c\u90a3\u4e48<code class=\"command\">pg_ctl</code>\u4f1a\u4ee5\u975e\u96f6\u9000\u51fa\u72b6\u6001\u9000\u51fa\u3002\u4e0d\u8fc7\u8bf7\u6ce8\u610f\uff0c\u8be5\u64cd\u4f5c\u4ecd\u53ef\u80fd\u5728\u540e\u53f0\u7ee7\u7eed\u8fdb\u884c\u5e76\u6700\u7ec8\u6210\u529f\u3002</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-W</code><br/></span><span class=\"term\"><code class=\"option\">--no-wait</code></span></dt>\n<dd>\n<p lang=\"zh\">\u4e0d\u7b49\u5f85\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e0e\u9009\u9879<code class=\"option\">-w</code>\u76f8\u53cd\u3002</p>\n<p lang=\"zh\">\u5982\u679c\u7981\u7528\u4e86\u7b49\u5f85\uff0c\u5c06\u89e6\u53d1\u6240\u8bf7\u6c42\u7684\u64cd\u4f5c\uff0c\u4f46\u4e0d\u4f1a\u53cd\u9988\u5176\u662f\u5426\u6210\u529f\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u501f\u52a9\u670d\u52a1\u5668\u65e5\u5fd7\u6587\u4ef6\u6216\u5916\u90e8\u76d1\u63a7\u7cfb\u7edf\u6765\u68c0\u67e5\u8be5\u64cd\u4f5c\u7684\u8fdb\u5c55\u53ca\u6210\u8d25\u3002</p>\n<p lang=\"zh\">\u5728 PostgreSQL \u5148\u524d\u7684\u53d1\u884c\u7248\u4e2d\uff0c\u9664\u4e86<code class=\"literal\">stop</code>\u6a21\u5f0f\u4e4b\u5916\uff0c\u8fd9\u66fe\u662f\u9ed8\u8ba4\u884c\u4e3a\u3002</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\u6709\u5173<span class=\"application\">pg_ctl</span>\u547d\u4ee4\u884c\u53c2\u6570\u7684\u5e2e\u52a9\u5e76\u9000\u51fa\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5982\u679c\u6307\u5b9a\u7684\u67d0\u4e2a\u9009\u9879\u672c\u8eab\u6709\u6548\uff0c\u4f46\u4e0e\u6240\u9009\u64cd\u4f5c\u6a21\u5f0f\u65e0\u5173\uff0c<span class=\"application\">pg_ctl</span>\u4f1a\u5ffd\u7565\u5b83\u3002</p>\n<div class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\">\n<h3 lang=\"zh\">\u7528\u4e8e Windows \u7684\u9009\u9879</h3>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"option\">-e <em class=\"replaceable\"><code>source</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u6307\u5b9a\u4ee5 Windows \u670d\u52a1\u65b9\u5f0f\u8fd0\u884c\u65f6\uff0c<span class=\"application\">pg_ctl</span>\u5199\u5165\u4e8b\u4ef6\u65e5\u5fd7\u6240\u4f7f\u7528\u7684\u4e8b\u4ef6\u6e90\u540d\u79f0\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002\u6ce8\u610f\uff0c\u8fd9\u53ea\u63a7\u5236\u7531<span class=\"application\">pg_ctl</span>\u672c\u8eab\u53d1\u9001\u7684\u6d88\u606f\uff1b\u670d\u52a1\u5668\u4e00\u65e6\u542f\u52a8\uff0c\u5c31\u4f1a\u4f7f\u7528\u5176<a class=\"xref\" href=\"/docs/18/runtime-config-logging.html#GUC-EVENT-SOURCE\">event_source</a>\u53c2\u6570\u6307\u5b9a\u7684\u4e8b\u4ef6\u6e90\u3002\u5982\u679c\u670d\u52a1\u5668\u5728\u542f\u52a8\u7684\u5f88\u65e9\u9636\u6bb5\u3001\u8be5\u53c2\u6570\u5c1a\u672a\u8bbe\u7f6e\u4e4b\u524d\u5c31\u5931\u8d25\uff0c\u5b83\u4e5f\u53ef\u80fd\u4f7f\u7528\u9ed8\u8ba4\u4e8b\u4ef6\u6e90\u540d\u79f0<code class=\"literal\">PostgreSQL</code>\u8bb0\u5f55\u65e5\u5fd7\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-N <em class=\"replaceable\"><code>servicename</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u8981\u6ce8\u518c\u7684\u7cfb\u7edf\u670d\u52a1\u540d\u79f0\u3002\u8be5\u540d\u79f0\u4f1a\u540c\u65f6\u7528\u4f5c\u670d\u52a1\u540d\u548c\u663e\u793a\u540d\u3002\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">PostgreSQL</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-P <em class=\"replaceable\"><code>password</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u5bc6\u7801\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-S <em class=\"replaceable\"><code>start-type</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u7c7b\u578b\u3002<em class=\"replaceable\"><code>start-type</code></em>\u53ef\u4ee5\u662f<code class=\"literal\">auto</code>\u3001<code class=\"literal\">demand</code>\uff0c\u6216\u8005\u4e24\u8005\u4e4b\u4e00\u7684\u9996\u5b57\u6bcd\u3002\u82e5\u7701\u7565\u6b64\u9009\u9879\uff0c\u5219\u9ed8\u8ba4\u503c\u4e3a<code class=\"literal\">auto</code>\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"option\">-U <em class=\"replaceable\"><code>username</code></em></code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7528\u4e8e\u8fd0\u884c\u8be5\u670d\u52a1\u7684\u7528\u6237\u540d\u3002\u5bf9\u4e8e\u57df\u7528\u6237\uff0c\u8bf7\u4f7f\u7528<code class=\"literal\">DOMAIN\\username</code>\u683c\u5f0f\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.7\">\n<h2 lang=\"zh\">\u73af\u5883</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"envar\">PGCTLTIMEOUT</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u7b49\u5f85\u542f\u52a8\u6216\u5173\u95ed\u5b8c\u6210\u65f6\uff0c\u9ed8\u8ba4\u7684\u7b49\u5f85\u79d2\u6570\u4e0a\u9650\u3002\u5982\u679c\u672a\u8bbe\u7f6e\uff0c\u9ed8\u8ba4\u503c\u4e3a 60 \u79d2\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\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n<p lang=\"zh\">\u5927\u591a\u6570 pg_ctl \u6a21\u5f0f\u90fd\u9700\u8981\u77e5\u9053\u6570\u636e\u76ee\u5f55\u7684\u4f4d\u7f6e\uff0c\u56e0\u6b64\u9664\u975e\u5df2\u8bbe\u7f6e PGDATA\uff0c\u5426\u5219\u5fc5\u987b\u63d0\u4f9b -D \u9009\u9879\u3002</p>\n<p lang=\"zh\">\u5176\u4ed6\u4f1a\u5f71\u54cd\u670d\u52a1\u5668\u7684\u53d8\u91cf\uff0c\u89c1<a class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a>\u3002</p>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.8\">\n<h2 lang=\"zh\">\u6587\u4ef6</h2>\n<div class=\"variablelist\">\n<dl class=\"variablelist\">\n<dt><span class=\"term\"><code class=\"filename\">postmaster.pid</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p><span class=\"application\">pg_ctl</span>\u4f1a\u68c0\u67e5\u6570\u636e\u76ee\u5f55\u4e2d\u7684\u8fd9\u4e2a\u6587\u4ef6\uff0c\u4ee5\u786e\u5b9a\u670d\u52a1\u5668\u5f53\u524d\u662f\u5426\u6b63\u5728\u8fd0\u884c\u3002</p>\n</p>\n</dd>\n<dt><span class=\"term\"><code class=\"filename\">postmaster.opts</code></span></dt>\n<dd>\n<p lang=\"zh\">\n<p>\u5982\u679c\u8be5\u6587\u4ef6\u5b58\u5728\u4e8e\u6570\u636e\u76ee\u5f55\u4e2d\uff0c<span class=\"application\">pg_ctl</span>\uff08\u5728<code class=\"option\">restart</code>\u6a21\u5f0f\u4e0b\uff09\u4f1a\u5c06\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4f5c\u4e3a\u9009\u9879\u4f20\u9012\u7ed9<span class=\"application\">postgres</span>\uff0c\u9664\u975e\u88ab<code class=\"option\">-o</code>\u9009\u9879\u8986\u76d6\u3002\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\u4e5f\u4f1a\u5728<code class=\"option\">status</code>\u6a21\u5f0f\u4e0b\u663e\u793a\u51fa\u6765\u3002</p>\n</p>\n</dd>\n</dl>\n</div>\n</div>\n<div class=\"refsect1\" id=\"R1-APP-PGCTL-2\">\n<h2 lang=\"zh\">\u793a\u4f8b</h2>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-3\">\n<h3 lang=\"zh\">\u542f\u52a8\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u542f\u52a8\u670d\u52a1\u5668\u5e76\u7b49\u5f85\u5176\u5f00\u59cb\u63a5\u53d7\u8fde\u63a5\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl start</code></strong>\n</pre>\n<p lang=\"zh\">\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u542f\u52a8\u670d\u52a1\u5668\uff0c\u5e76\u5728\u672a\u542f\u7528<code class=\"function\">fsync</code>\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" start</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-4\">\n<h3 lang=\"zh\">\u505c\u6b62\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u8981\u505c\u6b62\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop</code></strong>\n</pre>\n<p lang=\"zh\"><code class=\"option\">-m</code>\u9009\u9879\u5141\u8bb8\u63a7\u5236\u670d\u52a1\u5668<span class=\"emphasis\"><em>\u5982\u4f55</em></span>\u5173\u95ed\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl stop -m smart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-5\">\n<h3 lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668</h3>\n<p lang=\"zh\">\u91cd\u542f\u670d\u52a1\u5668\u51e0\u4e4e\u7b49\u540c\u4e8e\u5148\u505c\u6b62\u670d\u52a1\u5668\u518d\u91cd\u65b0\u542f\u52a8\uff0c\u53ea\u4e0d\u8fc7\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code class=\"command\">pg_ctl</code>\u4f1a\u4fdd\u5b58\u5e76\u91cd\u7528\u4f20\u7ed9\u524d\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u7684\u547d\u4ee4\u884c\u9009\u9879\u3002\u8981\u4f7f\u7528\u4e0e\u4e4b\u524d\u76f8\u540c\u7684\u9009\u9879\u91cd\u542f\u670d\u52a1\u5668\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl restart</code></strong>\n</pre>\n<p lang=\"zh\">\u4f46\u662f\uff0c\u5982\u679c\u6307\u5b9a\u4e86<code class=\"option\">-o</code>\uff0c\u5c31\u4f1a\u66ff\u6362\u5148\u524d\u7684\u6240\u6709\u9009\u9879\u3002\u8981\u4f7f\u7528\u7aef\u53e3 5433 \u91cd\u542f\u670d\u52a1\u5668\uff0c\u5e76\u5728\u91cd\u542f\u65f6\u7981\u7528<code class=\"function\">fsync</code>\uff0c\u53ef\u4f7f\u7528\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl -o \"-F -p 5433\" restart</code></strong>\n</pre>\n</div>\n<div class=\"refsect2\" id=\"R2-APP-PGCTL-6\">\n<h3 lang=\"zh\">\u663e\u793a\u670d\u52a1\u5668\u72b6\u6001</h3>\n<p lang=\"zh\">\u4e0b\u9762\u662f<span class=\"application\">pg_ctl</span>\u72b6\u6001\u8f93\u51fa\u7684\u793a\u4f8b\uff1a</p>\n<pre class=\"screen\"><code class=\"prompt\">$</code> <strong class=\"userinput\"><code>pg_ctl status</code></strong>\n<code class=\"computeroutput\">\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n</code>\n</pre>\n<p lang=\"zh\">\u7b2c\u4e8c\u884c\u662f\u5728\u91cd\u542f\u6a21\u5f0f\u4e0b\u4f1a\u8c03\u7528\u7684\u547d\u4ee4\u3002</p>\n</div>\n</div>\n<div class=\"refsect1\" id=\"id-1.9.5.8.10\">\n<h2 lang=\"zh\">\u53e6\u89c1</h2><span class=\"simplelist\"><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-postgres.html\" title=\"postgres\"><span class=\"refentrytitle\"><span class=\"application\">postgres</span></span></a></span>\n</div>\n</div></div>", "manual_path": "app-pg-ctl.html", "localization": {"status": "complete", "sources": [{"url": "/docs/18/app-pg-ctl.html", "method": "same-major semantic node", "sha256": "0c57a8d446a7fcb6f1d74816702835d7f69efa2ae491f801520c5a12b219567b", "language": "zh", "matched_nodes": ["#APP-PG-CTL/div[2]/p[1]", "#APP-PG-CTL/div[3]/h2[0]", "#APP-PG-CTL/div[3]/p[10]", "#APP-PG-CTL/div[4]/p[10]", "#APP-PG-CTL/div[4]/p[11]", "#APP-PG-CTL/div[4]/p[12]", "#APP-PG-CTL/div[4]/p[1]", "#APP-PG-CTL/div[4]/p[2]", "#APP-PG-CTL/div[4]/p[3]", "#APP-PG-CTL/div[4]/p[4]", "#APP-PG-CTL/div[4]/p[5]", "#APP-PG-CTL/div[4]/p[6]", "#APP-PG-CTL/div[4]/p[8]", "#APP-PG-CTL/div[4]/p[9]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[11]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[13]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[15]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[17]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[19]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[21]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[1]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[23]/p[2]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[25]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[0]", "#APP-PG-CTL/div[5]/div[1]/dl[0]/dd[9]/p[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[5]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[7]", "#APP-PG-CTL/div[5]/div[3]/div[1]/dl[0]/dd[9]", "#APP-PG-CTL/div[5]/div[3]/h3[0]", "#APP-PG-CTL/div[5]/p[2]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[6]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[6]/h2[0]", "#APP-PG-CTL/div[6]/p[3]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[1]", "#APP-PG-CTL/div[7]/div[1]/dl[0]/dd[3]", "#APP-PG-CTL/div[7]/h2[0]", "#APP-PG-CTL/div[8]/div[1]/h3[0]", "#APP-PG-CTL/div[8]/div[1]/p[1]", "#APP-PG-CTL/div[8]/div[1]/p[3]", "#APP-PG-CTL/div[8]/div[2]/h3[0]", "#APP-PG-CTL/div[8]/div[2]/p[1]", "#APP-PG-CTL/div[8]/div[2]/p[3]", "#APP-PG-CTL/div[8]/div[3]/h3[0]", "#APP-PG-CTL/div[8]/div[3]/p[1]", "#APP-PG-CTL/div[8]/div[3]/p[3]", "#APP-PG-CTL/div[8]/div[4]/h3[0]", "#APP-PG-CTL/div[8]/div[4]/p[1]", "#APP-PG-CTL/div[8]/div[4]/p[3]", "#APP-PG-CTL/div[8]/h2[0]", "#APP-PG-CTL/div[9]/h2[0]"]}], "language": "zh", "original_text": {"/versions/18/description/0": "pg_ctl \u2014 initialize, start, stop, or control a PostgreSQL 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": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.", "/versions/18/tables/0/rows/1/summary": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.", "/versions/18/tables/0/rows/2/summary": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.", "/versions/18/tables/0/rows/3/summary": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default.", "/versions/18/tables/0/rows/4/summary": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through.", "/versions/18/tables/0/rows/5/summary": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through.", "/versions/18/tables/0/rows/6/summary": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.", "/versions/18/tables/0/rows/7/summary": "Print only errors, no informational messages.", "/versions/18/tables/0/rows/8/summary": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.", "/versions/18/tables/0/rows/9/summary": "Print the pg_ctl version and exit.", "/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": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes.", "/versions/18/tables/0/rows/11/summary": "Do not wait for the operation to complete. This is the opposite of the option -w .", "/versions/18/tables/0/rows/12/summary": "Show help about pg_ctl command line arguments, and exit.", "/versions/18/tables/0/rows/13/summary": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL .", "/versions/18/tables/0/rows/14/summary": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL .", "/versions/18/tables/0/rows/15/summary": "Password for the user to run the service as.", "/versions/18/tables/0/rows/16/summary": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default.", "/versions/18/tables/0/rows/17/summary": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username .", "/versions/18/tables/1/columns/0/label": "Variable", "/versions/18/tables/1/columns/1/label": "Meaning", "/versions/18/tables/1/rows/0/description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.", "/versions/18/tables/1/rows/1/description": "Default data directory location."}, "fallback_fields": [], "source_language": "en", "original_snapshot_sha256": "a73c131294fda805a1d49a5a28057f64eb9a0f413c84413b7fd6e649544ea84a"}, "comparison_data": {"options": [{"names": ["-c", "--core-files"], "signature": "-c --core-files", "description": "Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process."}, {"names": ["-D datadir", "--pgdata= datadir"], "signature": "-D datadir --pgdata= datadir", "description": "Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."}, {"names": ["-l filename", "--log= filename"], "signature": "-l filename --log= filename", "description": "Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it."}, {"names": ["-m mode", "--mode= mode"], "signature": "-m mode --mode= mode", "description": "Specifies the shutdown mode. mode can be smart , fast , or immediate , or the first letter of one of these three. If this option is omitted, fast is the default."}, {"names": ["-o options", "--options= options"], "signature": "-o options --options= options", "description": "Specifies options to be passed directly to the postgres command. -o can be specified multiple times, with all the given options being passed through. The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-o initdb-options", "--options= initdb-options"], "signature": "-o initdb-options --options= initdb-options", "description": "Specifies options to be passed directly to the initdb command. -o can be specified multiple times, with all the given options being passed through. The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group."}, {"names": ["-p path"], "signature": "-p path", "description": "Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl , or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found. In init mode, this option analogously specifies the location of the initdb executable."}, {"names": ["-s", "--silent"], "signature": "-s --silent", "description": "Print only errors, no informational messages."}, {"names": ["-t seconds", "--timeout= seconds"], "signature": "-t seconds --timeout= seconds", "description": "Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w ). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds."}, {"names": ["-V", "--version"], "signature": "-V --version", "description": "Print the pg_ctl version and exit."}, {"names": ["-w", "--wait"], "signature": "-w --wait", "description": "Wait for the operation to complete. This is supported for the modes start , stop , restart , promote , and register , and is the default for those modes. When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file. pg_ctl returns an exit code based on the success of the startup or shutdown. If the operation does not complete within the timeout (see option -t ), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed."}, {"names": ["-W", "--no-wait"], "signature": "-W --no-wait", "description": "Do not wait for the operation to complete. This is the opposite of the option -w . If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation. In prior releases of PostgreSQL, this was the default except for the stop mode."}, {"names": ["-?", "--help"], "signature": "-? --help", "description": "Show help about pg_ctl command line arguments, and exit."}, {"names": ["-e source"], "signature": "-e source", "description": "Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL . Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL ."}, {"names": ["-N servicename"], "signature": "-N servicename", "description": "Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL ."}, {"names": ["-P password"], "signature": "-P password", "description": "Password for the user to run the service as."}, {"names": ["-S start-type"], "signature": "-S start-type", "description": "Start type of the system service. start-type can be auto , or demand , or the first letter of one of these two. If this option is omitted, auto is the default."}, {"names": ["-U username"], "signature": "-U username", "description": "User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}], "synopsis": ["pg_ctl init[db] [ -D datadir ] [ -s ] [ -o initdb-options ]", "pg_ctl start [ -D datadir ] [ -l filename ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -p path ] [ -c ]", "pg_ctl stop [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl restart [ -D datadir ] [ -m s[mart] | f[ast] | i[mmediate] ] [ -W ] [ -t seconds ] [ -s ] [ -o options ] [ -c ]", "pg_ctl reload [ -D datadir ] [ -s ]", "pg_ctl status [ -D datadir ]", "pg_ctl promote [ -D datadir ] [ -W ] [ -t seconds ] [ -s ]", "pg_ctl logrotate [ -D datadir ] [ -s ]", "pg_ctl kill signal_name process_id", "pg_ctl register [ -D datadir ] [ -N servicename ] [ -U username ] [ -P password ] [ -S a[uto] | d[emand] ] [ -e source ] [ -W ] [ -t seconds ] [ -s ] [ -o options ]", "pg_ctl unregister [ -N servicename ]"], "environment": [{"name": "PGCTLTIMEOUT", "description": "Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds."}, {"name": "PGDATA", "description": "Default data directory location."}]}, "comparison_hash": "4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53", "manual_language": "zh"}, "comparison": {"left": "13", "right": "14", "status": "changed", "diff": "--- PostgreSQL 13\n+++ PostgreSQL 14\n@@ -27,7 +27,7 @@\n       \"signature\": \"-D datadir --pgdata= datadir\"\n     },\n     {\n-      \"description\": \"Append the server log output to filename . If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.\",\n+      \"description\": \"Append the server log output to filename . If the file does not exist, it is created. By default, only the cluster owner can access the log file. If group access is enabled in the cluster, users in the same group as the cluster owner can also read it.\",\n       \"names\": [\n         \"-l filename\",\n         \"--log= filename\""}}