{"Entry":{"collection":"tool","key":"pg-ctl","name":"pg_ctl","aliases":["pg_ctl"],"metadata":{"aliases":["pg_ctl"],"category":"Server applications","content_hash":"5aadba1119910e63d661fae71ee80b57a239eb75b5fe35d3764c71d85dda2db3","derived_content_hash":"b67cffc71279f013c99cc2ec3bc0925b7dcb823770460d1c67d0419fb8733643","imported_at":"2026-09-30T00:40:34.145525+08:00","name":"pg_ctl","name_zh":"","slug":"pg-ctl","summary":"pg_ctl — initialize, start, stop, or control a PostgreSQL server"}},"Definition":{"Collection":"tool","Key":"pg-ctl","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"pg-ctl","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[{"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":"PGCTLTIMEOUT"},{"description":"Default data directory location.","name":"PGDATA"}],"options":[{"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":["-c","--core-files"],"signature":"-c --core-files"},{"description":"Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.","names":["-D datadir","--pgdata= datadir"],"signature":"-D datadir --pgdata= datadir"},{"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":["-l filename","--log= filename"],"signature":"-l filename --log= filename"},{"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":["-m mode","--mode= mode"],"signature":"-m mode --mode= mode"},{"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 options","--options= options"],"signature":"-o options --options= 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":["-o initdb-options","--options= initdb-options"],"signature":"-o initdb-options --options= initdb-options"},{"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":["-p path"],"signature":"-p path"},{"description":"Print only errors, no informational messages.","names":["-s","--silent"],"signature":"-s --silent"},{"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":["-t seconds","--timeout= seconds"],"signature":"-t seconds --timeout= seconds"},{"description":"Print the pg_ctl version and exit.","names":["-V","--version"],"signature":"-V --version"},{"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","--wait"],"signature":"-w --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":["-W","--no-wait"],"signature":"-W --no-wait"},{"description":"Show help about pg_ctl command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"},{"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":["-e source"],"signature":"-e source"},{"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":["-N servicename"],"signature":"-N servicename"},{"description":"Password for the user to run the service as.","names":["-P password"],"signature":"-P password"},{"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":["-S start-type"],"signature":"-S start-type"},{"description":"User name for the user to run the service as. For domain users, use the format DOMAIN\\username .","names":["-U username"],"signature":"-U 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 ]"]},"comparison_hash":"4f93544f233f78079879f3558fb85c50105c0a56ac14b06e075ce6a0b934ea53","description":["pg_ctl — initialize, start, stop, or control a PostgreSQL server"],"description_zh":"描述 pg_ctl 是一个实用工具，用于初始化 PostgreSQL 数据库集簇，启动、停止或重启 PostgreSQL 数据库服务器（ postgres ），或者显示正在运行的服务器的状态。虽然服务器也可以手工启动，但 pg_ctl 将重定向日志输出、正确地与终端和进程组脱离等任务封装了起来。它还提供了便于实施受控关闭的选项。 init 或 initdb 模式会创建一个新的 PostgreSQL 数据库集簇，也就是由单个服务器实例管理的一组数据库。该模式会调用 initdb 命令。详见 initdb 。 start 模式会启动一个新服务器。服务器在后台启动，其标准输入连接到 /dev/null （在 Windows 上则是 nul ）。在类 Unix 系统上，默认情况下，服务器的标准输出和标准错误会被发送到 pg_ctl 的标准输出（而不是标准错误）。因此， pg_ctl 的标准输出应被重定向到文件，或者通过管道传给另一个进程，例如 rotatelogs 这样的日志轮转程序；否则 postgres 会在后台将其输出写入控制终端，并且不会脱离 shell 的进程组。在 Windows 上，默认情况下，服务器的标准输出和标准错误会被发送到终端。使用 -l 将服务器输出追加到日志文件，可以改变这些默认行为。建议使用 -l 或输出重定向。 stop 模式会关闭在指定数据目录中运行的服务器。可以使用 -m 选项选择三种不同的关闭方法。 “ Smart ” 模式不允许新连接，然后等待所有现有客户端断开。如果服务器处于热备状态，那么在所有客户端断开后，恢复和流复制都会终止。 “ Fast ” 模式（默认值）不等待客户端断开。所有活动事务都会回滚，客户端会被强制断开，然后服务器关闭。 “ Immediate ” 模式会立即中止所有服务器进程，而不执行干净关闭。这样会导致服务器在下次启动时进入一次崩溃恢复周期。 restart 模式实际上就是先执行停止再执行启动。这使得可以修改 postgres 的命令行选项，或者修改那些不重启服务器就无法更改的配置文件选项。如果服务器启动时在命令行中","description_zh_html":"\u003cp\u003e命令行工具 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 ]。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 是一个实用工具，用于初始化 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 数据库集簇，启动、停止或重启 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 数据库服务器（\u003ca class=\"xref\" href=\"/zh/docs/18/app-postgres.html\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e），或者显示正在运行的服务器的状态。虽然服务器也可以手工启动，但 \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 将重定向日志输出、正确地与终端和进程组脱离等任务封装了起来。它还提供了便于实施受控关闭的选项。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003einit\u003c/code\u003e 或 \u003ccode class=\"option\"\u003einitdb\u003c/code\u003e 模式会创建一个新的 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 数据库集簇，也就是由单个服务器实例管理的一组数据库。该模式会调用 \u003ccode class=\"command\"\u003einitdb\u003c/code\u003e 命令。详见 \u003ca class=\"xref\" href=\"/zh/docs/18/app-initdb.html\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003einitdb\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003estart\u003c/code\u003e 模式会启动一个新服务器。服务器在后台启动，其标准输入连接到 \u003ccode class=\"filename\"\u003e/dev/null\u003c/code\u003e（在 Windows 上则是 \u003ccode class=\"literal\"\u003enul\u003c/code\u003e）。在类 Unix 系统上，默认情况下，服务器的标准输出和标准错误会被发送到 \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 的标准输出（而不是标准错误）。因此，\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 的标准输出应被重定向到文件，或者通过管道传给另一个进程，例如 \u003cspan class=\"application\"\u003erotatelogs\u003c/span\u003e 这样的日志轮转程序；否则 \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e 会在后台将其输出写入控制终端，并且不会脱离 shell 的进程组。在 Windows 上，默认情况下，服务器的标准输出和标准错误会被发送到终端。使用 \u003ccode class=\"option\"\u003e-l\u003c/code\u003e 将服务器输出追加到日志文件，可以改变这些默认行为。建议使用 \u003ccode class=\"option\"\u003e-l\u003c/code\u003e 或输出重定向。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003estop\u003c/code\u003e 模式会关闭在指定数据目录中运行的服务器。可以使用 \u003ccode class=\"option\"\u003e-m\u003c/code\u003e 选项选择三种不同的关闭方法。\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eSmart\u003c/span\u003e”\u003c/span\u003e模式不允许新连接，然后等待所有现有客户端断开。如果服务器处于热备状态，那么在所有客户端断开后，恢复和流复制都会终止。\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eFast\u003c/span\u003e”\u003c/span\u003e模式（默认值）不等待客户端断开。所有活动事务都会回滚，客户端会被强制断开，然后服务器关闭。\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eImmediate\u003c/span\u003e”\u003c/span\u003e模式会立即中止所有服务器进程，而不执行干净关闭。这样会导致服务器在下次启动时进入一次崩溃恢复周期。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003erestart\u003c/code\u003e 模式实际上就是先执行停止再执行启动。这使得可以修改 \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e 的命令行选项，或者修改那些不重启服务器就无法更改的配置文件选项。如果服务器启动时在命令行中使用了相对路径，那么除非在与服务器上次启动时相同的当前目录中执行 \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e，否则 \u003ccode class=\"option\"\u003erestart\u003c/code\u003e 可能失败。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003ereload\u003c/code\u003e 模式只是向 \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e 服务器进程发送一个 \u003cspan class=\"systemitem\"\u003eSIGHUP\u003c/span\u003e 信号，使其重新读取配置文件（\u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e、\u003ccode class=\"filename\"\u003epg_hba.conf\u003c/code\u003e 等）。这样就可以修改那些无需完全重启服务器即可生效的配置文件选项。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003estatus\u003c/code\u003e 模式会检查指定数据目录中是否有服务器正在运行。若有，则显示服务器的 \u003cacronym class=\"acronym\"\u003ePID\u003c/acronym\u003e 以及调用它时使用的命令行选项。若服务器未运行，\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 返回退出状态 3。若未指定一个可访问的数据目录，\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 返回退出状态 4。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003epromote\u003c/code\u003e 模式会指示在指定数据目录中运行的备库结束备库模式，并开始进行读写操作。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003elogrotate\u003c/code\u003e 模式轮换服务器日志文件。有关如何将此模式与外部日志轮换工具一起使用的详细信息，参见\u003ca class=\"xref\" href=\"/zh/docs/18/logfile-maintenance.html\"\u003e第 24.3 节\u003c/a\u003e。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003ekill\u003c/code\u003e 模式向指定进程发送信号。这在没有内置 \u003cspan class=\"application\"\u003ekill\u003c/span\u003e 命令的 \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e 上尤其有用。使用 \u003ccode class=\"literal\"\u003e--help\u003c/code\u003e 可查看受支持的信号名称列表。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003eregister\u003c/code\u003e 模式会将 \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e 服务器注册为 \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e 上的系统服务。\u003ccode class=\"option\"\u003e-S\u003c/code\u003e 选项允许选择服务启动类型，可以是\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eauto\u003c/span\u003e”\u003c/span\u003e（系统启动时自动启动服务）或\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edemand\u003c/span\u003e”\u003c/span\u003e（按需启动服务）。\n  \u003c/p\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003eunregister\u003c/code\u003e 模式会在 \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e 上注销一个系统服务。这会撤销 \u003ccode class=\"option\"\u003eregister\u003c/code\u003e 命令的效果。\n  \u003c/p\u003e\u003c/div\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e选项\u003c/h2\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--core-files\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        在支持的平台上，通过解除对核心转储文件施加的任何软资源限制，尝试允许服务器在崩溃时生成核心转储文件。这样就可以从失败的服务器进程中获得栈跟踪，从而有助于调试或诊断问题。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pgdata=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定数据库配置文件所在的文件系统位置。若省略此选项，则使用环境变量 \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--log=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        将服务器日志输出追加到 \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e。如果该文件不存在，就会创建它。默认情况下，只有集簇拥有者可以访问该日志文件。如果在集簇中启用了组访问权限，与集簇拥有者同组的用户也可以读取它。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-m \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--mode=\u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定关闭模式。\u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e 可以是 \u003ccode class=\"literal\"\u003esmart\u003c/code\u003e、\u003ccode class=\"literal\"\u003efast\u003c/code\u003e 或 \u003ccode class=\"literal\"\u003eimmediate\u003c/code\u003e，也可以是这三者之一的首字母。若省略此选项，则默认值为 \u003ccode class=\"literal\"\u003efast\u003c/code\u003e。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--options=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定要直接传递给 \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e 命令的选项。\u003ccode class=\"option\"\u003e-o\u003c/code\u003e 可以指定多次，给出的所有选项都会被传递过去。\n       \u003c/p\u003e\u003cp\u003e\n        通常应将 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e 放在单引号或双引号中，以确保它们作为一个整体被传递。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--options=\u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定要直接传递给 \u003ccode class=\"command\"\u003einitdb\u003c/code\u003e 命令的选项。\u003ccode class=\"option\"\u003e-o\u003c/code\u003e 可以指定多次，给出的所有选项都会被传递过去。\n       \u003c/p\u003e\u003cp\u003e\n        通常应将 \u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e 放在单引号或双引号中，以确保它们作为一个整体被传递。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003epath\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定 \u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e 可执行程序的位置。默认情况下，\u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e 可执行程序取自与 \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e 相同的目录；如果那里没有，则取自硬编码的安装目录。除非采用了某些非常规方式，并收到找不到 \u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e 可执行程序的错误，否则通常不需要使用此选项。\n       \u003c/p\u003e\u003cp\u003e\n        在 \u003ccode class=\"literal\"\u003einit\u003c/code\u003e 模式中，此选项同样指定 \u003ccode class=\"filename\"\u003einitdb\u003c/code\u003e 可执行程序的位置。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--silent\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        只打印错误，不打印信息性消息。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--timeout=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        指定等待某个操作完成时最多等待多少秒（见选项 \u003ccode class=\"option\"\u003e-w\u003c/code\u003e）。默认值为环境变量 \u003ccode class=\"envar\"\u003ePGCTLTIMEOUT\u003c/code\u003e 的值；如果未设置该环境变量，则默认为 60 秒。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n         打印 \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 的版本并退出。\n        \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--wait\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        等待操作完成。\u003ccode class=\"literal\"\u003estart\u003c/code\u003e、\u003ccode class=\"literal\"\u003estop\u003c/code\u003e、\u003ccode class=\"literal\"\u003erestart\u003c/code\u003e、\u003ccode class=\"literal\"\u003epromote\u003c/code\u003e 和 \u003ccode class=\"literal\"\u003eregister\u003c/code\u003e 模式支持此选项，而且对这些模式来说它是默认行为。\n       \u003c/p\u003e\u003cp\u003e\n        在等待期间，\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e 会反复检查服务器的 \u003cacronym class=\"acronym\"\u003ePID\u003c/acronym\u003e 文件，并在两次检查之间短暂休眠。当 \u003cacronym class=\"acronym\"\u003ePID\u003c/acronym\u003e 文件表明服务器已准备好接受连接时，启动就被视为完成。当服务器移除 \u003cacronym class=\"acronym\"\u003ePID\u003c/acronym\u003e 文件时，关闭就被视为完成。\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e 会根据启动或关闭是否成功返回相应的退出代码。\n       \u003c/p\u003e\u003cp\u003e\n        如果操作未能在超时时间内完成（见选项 \u003ccode class=\"option\"\u003e-t\u003c/code\u003e），那么 \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e 会以非零退出状态退出。不过请注意，该操作仍可能在后台继续进行并最终成功。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-wait\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        不等待操作完成。这与选项 \u003ccode class=\"option\"\u003e-w\u003c/code\u003e 相反。\n       \u003c/p\u003e\u003cp\u003e\n        如果禁用了等待，将触发所请求的操作，但不会反馈其是否成功。在这种情况下，需要借助服务器日志文件或外部监控系统来检查该操作的进展及成败。\n       \u003c/p\u003e\u003cp\u003e\n        在 PostgreSQL 先前的发行版中，除了 \u003ccode class=\"literal\"\u003estop\u003c/code\u003e 模式之外，这曾是默认行为。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr/\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        显示有关 \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 命令行参数的帮助并退出。\n       \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n   如果指定的某个选项本身有效，但与所选操作模式无关，\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 会忽略它。\n  \u003c/p\u003e\u003cdiv class=\"refsect2\"\u003e\u003ch3\u003e用于 Windows 的选项\u003c/h3\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       指定以 Windows 服务方式运行时，\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 写入事件日志所使用的事件源名称。默认值为 \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e。注意，这只控制由 \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e 本身发送的消息；服务器一旦启动，就会使用其 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-logging.html#GUC-EVENT-SOURCE\"\u003eevent_source\u003c/a\u003e 参数指定的事件源。如果服务器在启动的很早阶段、该参数尚未设置之前就失败，它也可能使用默认事件源名称 \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e 记录日志。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N \u003cem class=\"replaceable\"\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       要注册的系统服务名称。该名称会同时用作服务名和显示名。默认值为 \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P \u003cem class=\"replaceable\"\u003e\u003ccode\u003epassword\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       用于运行该服务的用户密码。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S \u003cem class=\"replaceable\"\u003e\u003ccode\u003estart-type\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       系统服务的启动类型。\u003cem class=\"replaceable\"\u003e\u003ccode\u003estart-type\u003c/code\u003e\u003c/em\u003e 可以是 \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e、\u003ccode class=\"literal\"\u003edemand\u003c/code\u003e，或者两者之一的首字母。若省略此选项，则默认值为 \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e。\n      \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n       用于运行该服务的用户名。对于域用户，请使用 \u003ccode class=\"literal\"\u003eDOMAIN\\username\u003c/code\u003e 格式。\n      \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/app-pg-ctl.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","environment":[{"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":"PGCTLTIMEOUT"},{"description":"Default data directory location.","name":"PGDATA"}],"facts":[{"label":"Documented executable","value":"pg_ctl"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Server applications"},{"label":"Option definition groups","value":"18"}],"facts_zh":[{"label":"手册中的可执行程序","value":"pg_ctl"},{"label":"程序版本","value":"18.6"},{"label":"参考清单","value":"服务端程序"},{"label":"选项定义组","value":"18"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PG-CTL\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_ctl — initialize, start, stop, or control a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e server\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.1\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003einit[db]\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-o\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.2\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003estart\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-l\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-o\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-p\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003epath\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-c\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.3\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003estop\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-m\u003c/code\u003e \u003ccode class=\"option\"\u003es[mart]\u003c/code\u003e | \u003ccode class=\"option\"\u003ef[ast]\u003c/code\u003e | \u003ccode class=\"option\"\u003ei[mmediate]\u003c/code\u003e ] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.4\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003erestart\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-m\u003c/code\u003e \u003ccode class=\"option\"\u003es[mart]\u003c/code\u003e | \u003ccode class=\"option\"\u003ef[ast]\u003c/code\u003e | \u003ccode class=\"option\"\u003ei[mmediate]\u003c/code\u003e ] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-o\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-c\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.5\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003ereload\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.6\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003estatus\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.7\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003epromote\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.8\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003elogrotate\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.9\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003ekill\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esignal_name\u003c/code\u003e\u003c/em\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eprocess_id\u003c/code\u003e\u003c/em\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eOn Microsoft Windows, also:\u003c/p\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.11\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003eregister\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-N\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-U\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-P\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003epassword\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-S\u003c/code\u003e \u003ccode class=\"option\"\u003ea[uto]\u003c/code\u003e | \u003ccode class=\"option\"\u003ed[emand]\u003c/code\u003e ] [\u003ccode class=\"option\"\u003e-e\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-o\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.12\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003eunregister\u003c/code\u003e [\u003ccode class=\"option\"\u003e-N\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e is a utility for initializing a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database cluster, starting, stopping, or restarting the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database server (\u003ca class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e), or displaying the status of a running server. Although the server can be started manually, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e encapsulates tasks such as redirecting log output and properly detaching from the terminal and process group. It also provides convenient options for controlled shutdown.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003einit\u003c/code\u003e or \u003ccode class=\"option\"\u003einitdb\u003c/code\u003e mode creates a new \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database cluster, that is, a collection of databases that will be managed by a single server instance. This mode invokes the \u003ccode class=\"command\"\u003einitdb\u003c/code\u003e command. See \u003ca class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003einitdb\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for details.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003estart\u003c/code\u003e mode launches a new server. The server is started in the background, and its standard input is attached to \u003ccode class=\"filename\"\u003e/dev/null\u003c/code\u003e (or \u003ccode class=\"literal\"\u003enul\u003c/code\u003e on Windows). On Unix-like systems, by default, the server's standard output and standard error are sent to \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e's standard output (not standard error). The standard output of \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e should then be redirected to a file or piped to another process such as a log rotating program like \u003cspan class=\"application\"\u003erotatelogs\u003c/span\u003e; otherwise \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e will write its output to the controlling terminal (from the background) and will not leave the shell's process group. On Windows, by default the server's standard output and standard error are sent to the terminal. These default behaviors can be changed by using \u003ccode class=\"option\"\u003e-l\u003c/code\u003e to append the server's output to a log file. Use of either \u003ccode class=\"option\"\u003e-l\u003c/code\u003e or output redirection is recommended.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003estop\u003c/code\u003e mode shuts down the server that is running in the specified data directory. Three different shutdown methods can be selected with the \u003ccode class=\"option\"\u003e-m\u003c/code\u003e option. \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eSmart\u003c/span\u003e”\u003c/span\u003e mode disallows new connections, then waits for all existing clients to disconnect. If the server is in hot standby, recovery and streaming replication will be terminated once all clients have disconnected. \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eFast\u003c/span\u003e”\u003c/span\u003e mode (the default) does not wait for clients to disconnect. All active transactions are rolled back and clients are forcibly disconnected, then the server is shut down. \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eImmediate\u003c/span\u003e”\u003c/span\u003e mode will abort all server processes immediately, without a clean shutdown. This choice will lead to a crash-recovery cycle during the next server start.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003erestart\u003c/code\u003e mode effectively executes a stop followed by a start. This allows changing the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e command-line options, or changing configuration-file options that cannot be changed without restarting the server. If relative paths were used on the command line during server start, \u003ccode class=\"option\"\u003erestart\u003c/code\u003e might fail unless \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e is executed in the same current directory as it was during server start.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003ereload\u003c/code\u003e mode simply sends the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server process a \u003cspan class=\"systemitem\"\u003eSIGHUP\u003c/span\u003e signal, causing it to reread its configuration files (\u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e, \u003ccode class=\"filename\"\u003epg_hba.conf\u003c/code\u003e, etc.). This allows changing configuration-file options that do not require a full server restart to take effect.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003estatus\u003c/code\u003e mode checks whether a server is running in the specified data directory. If it is, the server's PID and the command line options that were used to invoke it are displayed. If the server is not running, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e returns an exit status of 3. If an accessible data directory is not specified, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e returns an exit status of 4.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003epromote\u003c/code\u003e mode commands the standby server that is running in the specified data directory to end standby mode and begin read-write operations.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003elogrotate\u003c/code\u003e mode rotates the server log file. For details on how to use this mode with external log rotation tools, see \u003ca class=\"xref\" href=\"/docs/18/logfile-maintenance.html\" title=\"24.3. Log File Maintenance\"\u003eSection 24.3\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003ekill\u003c/code\u003e mode sends a signal to a specified process. This is primarily valuable on \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e which does not have a built-in \u003cspan class=\"application\"\u003ekill\u003c/span\u003e command. Use \u003ccode class=\"literal\"\u003e--help\u003c/code\u003e to see a list of supported signal names.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003eregister\u003c/code\u003e mode registers the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e server as a system service on \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e. The \u003ccode class=\"option\"\u003e-S\u003c/code\u003e option allows selection of service start type, either \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eauto\u003c/span\u003e”\u003c/span\u003e (start service automatically on system startup) or \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edemand\u003c/span\u003e”\u003c/span\u003e (start service on demand).\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003eunregister\u003c/code\u003e mode unregisters a system service on \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e. This undoes the effects of the \u003ccode class=\"option\"\u003eregister\u003c/code\u003e command.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--core-files\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAttempt 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pgdata=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file system location of the database configuration files. If this option is omitted, the environment variable \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--log=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAppend the server log output to \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-m \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--mode=\u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the shutdown mode. \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e can be \u003ccode class=\"literal\"\u003esmart\u003c/code\u003e, \u003ccode class=\"literal\"\u003efast\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eimmediate\u003c/code\u003e, or the first letter of one of these three. If this option is omitted, \u003ccode class=\"literal\"\u003efast\u003c/code\u003e is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--options=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies options to be passed directly to the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e command. \u003ccode class=\"option\"\u003e-o\u003c/code\u003e can be specified multiple times, with all the given options being passed through.\u003c/p\u003e\n\u003cp\u003eThe \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e should usually be surrounded by single or double quotes to ensure that they are passed through as a group.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--options=\u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies options to be passed directly to the \u003ccode class=\"command\"\u003einitdb\u003c/code\u003e command. \u003ccode class=\"option\"\u003e-o\u003c/code\u003e can be specified multiple times, with all the given options being passed through.\u003c/p\u003e\n\u003cp\u003eThe \u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e should usually be surrounded by single or double quotes to ensure that they are passed through as a group.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003epath\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the location of the \u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e executable. By default the \u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e executable is taken from the same directory as \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e, 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 \u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e executable was not found.\u003c/p\u003e\n\u003cp\u003eIn \u003ccode class=\"literal\"\u003einit\u003c/code\u003e mode, this option analogously specifies the location of the \u003ccode class=\"filename\"\u003einitdb\u003c/code\u003e executable.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--silent\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint only errors, no informational messages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--timeout=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the maximum number of seconds to wait when waiting for an operation to complete (see option \u003ccode class=\"option\"\u003e-w\u003c/code\u003e). Defaults to the value of the \u003ccode class=\"envar\"\u003ePGCTLTIMEOUT\u003c/code\u003e environment variable or, if not set, to 60 seconds.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--wait\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWait for the operation to complete. This is supported for the modes \u003ccode class=\"literal\"\u003estart\u003c/code\u003e, \u003ccode class=\"literal\"\u003estop\u003c/code\u003e, \u003ccode class=\"literal\"\u003erestart\u003c/code\u003e, \u003ccode class=\"literal\"\u003epromote\u003c/code\u003e, and \u003ccode class=\"literal\"\u003eregister\u003c/code\u003e, and is the default for those modes.\u003c/p\u003e\n\u003cp\u003eWhen waiting, \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e 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. \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e returns an exit code based on the success of the startup or shutdown.\u003c/p\u003e\n\u003cp\u003eIf the operation does not complete within the timeout (see option \u003ccode class=\"option\"\u003e-t\u003c/code\u003e), then \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-wait\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not wait for the operation to complete. This is the opposite of the option \u003ccode class=\"option\"\u003e-w\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eIf 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.\u003c/p\u003e\n\u003cp\u003eIn prior releases of PostgreSQL, this was the default except for the \u003ccode class=\"literal\"\u003estop\u003c/code\u003e mode.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eIf an option is specified that is valid, but not relevant to the selected operating mode, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e ignores it.\u003c/p\u003e\n\u003cdiv class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\"\u003e\n\u003ch3\u003eOptions for Windows\u003c/h3\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eName of the event source for \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e to use for logging to the event log when running as a Windows service. The default is \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e. Note that this only controls messages sent from \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e itself; once started, the server will use the event source specified by its \u003ca class=\"xref\" href=\"/docs/18/runtime-config-logging.html#GUC-EVENT-SOURCE\"\u003eevent_source\u003c/a\u003e 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 \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N \u003cem class=\"replaceable\"\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eName of the system service to register. This name will be used as both the service name and the display name. The default is \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P \u003cem class=\"replaceable\"\u003e\u003ccode\u003epassword\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePassword for the user to run the service as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S \u003cem class=\"replaceable\"\u003e\u003ccode\u003estart-type\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eStart type of the system service. \u003cem class=\"replaceable\"\u003e\u003ccode\u003estart-type\u003c/code\u003e\u003c/em\u003e can be \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e, or \u003ccode class=\"literal\"\u003edemand\u003c/code\u003e, or the first letter of one of these two. If this option is omitted, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name for the user to run the service as. For domain users, use the format \u003ccode class=\"literal\"\u003eDOMAIN\\username\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.8.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGCTLTIMEOUT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault data directory location.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eMost \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e modes require knowing the data directory location; therefore, the \u003ccode class=\"option\"\u003e-D\u003c/code\u003e option is required unless \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e is set.\u003c/p\u003e\n\u003cp\u003eFor additional variables that affect the server, see \u003ca class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.8.8\"\u003e\n\u003ch2\u003eFiles\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"filename\"\u003epostmaster.pid\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e examines this file in the data directory to determine whether the server is currently running.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"filename\"\u003epostmaster.opts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf this file exists in the data directory, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e (in \u003ccode class=\"option\"\u003erestart\u003c/code\u003e mode) will pass the contents of the file as options to \u003cspan class=\"application\"\u003epostgres\u003c/span\u003e, unless overridden by the \u003ccode class=\"option\"\u003e-o\u003c/code\u003e option. The contents of this file are also displayed in \u003ccode class=\"option\"\u003estatus\u003c/code\u003e mode.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"R1-APP-PGCTL-2\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cdiv class=\"refsect2\" id=\"R2-APP-PGCTL-3\"\u003e\n\u003ch3\u003eStarting the Server\u003c/h3\u003e\n\u003cp\u003eTo start the server, waiting until the server is accepting connections:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl start\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo start the server using port 5433, and running without \u003ccode class=\"function\"\u003efsync\u003c/code\u003e, use:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl -o \"-F -p 5433\" start\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"R2-APP-PGCTL-4\"\u003e\n\u003ch3\u003eStopping the Server\u003c/h3\u003e\n\u003cp\u003eTo stop the server, use:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl stop\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003e-m\u003c/code\u003e option allows control over \u003cspan class=\"emphasis\"\u003e\u003cem\u003ehow\u003c/em\u003e\u003c/span\u003e the server shuts down:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl stop -m smart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"R2-APP-PGCTL-5\"\u003e\n\u003ch3\u003eRestarting the Server\u003c/h3\u003e\n\u003cp\u003eRestarting the server is almost equivalent to stopping the server and starting it again, except that by default, \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e saves and reuses the command line options that were passed to the previously-running instance. To restart the server using the same options as before, use:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl restart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eBut if \u003ccode class=\"option\"\u003e-o\u003c/code\u003e is specified, that replaces any previous options. To restart using port 5433, disabling \u003ccode class=\"function\"\u003efsync\u003c/code\u003e upon restart:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl -o \"-F -p 5433\" restart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"R2-APP-PGCTL-6\"\u003e\n\u003ch3\u003eShowing the Server Status\u003c/h3\u003e\n\u003cp\u003eHere is sample status output from \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl status\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003e\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe second line is the command that would be invoked in restart mode.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.8.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003einitdb\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-pg-ctl.html","options":[{"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":["-c","--core-files"],"signature":"-c --core-files","source_url":"/docs/18/app-pg-ctl.html","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."},{"description":"Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.","names":["-D datadir","--pgdata= datadir"],"signature":"-D datadir --pgdata= datadir","source_url":"/docs/18/app-pg-ctl.html","summary":"Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."},{"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":["-l filename","--log= filename"],"signature":"-l filename --log= filename","source_url":"/docs/18/app-pg-ctl.html","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."},{"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":["-m mode","--mode= mode"],"signature":"-m mode --mode= mode","source_url":"/docs/18/app-pg-ctl.html","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."},{"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 options","--options= options"],"signature":"-o options --options= options","source_url":"/docs/18/app-pg-ctl.html","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."},{"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":["-o initdb-options","--options= initdb-options"],"signature":"-o initdb-options --options= initdb-options","source_url":"/docs/18/app-pg-ctl.html","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."},{"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":["-p path"],"signature":"-p path","source_url":"/docs/18/app-pg-ctl.html","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."},{"description":"Print only errors, no informational messages.","names":["-s","--silent"],"signature":"-s --silent","source_url":"/docs/18/app-pg-ctl.html","summary":"Print only errors, no informational messages."},{"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":["-t seconds","--timeout= seconds"],"signature":"-t seconds --timeout= seconds","source_url":"/docs/18/app-pg-ctl.html","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."},{"description":"Print the pg_ctl version and exit.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/app-pg-ctl.html","summary":"Print the pg_ctl version and exit."},{"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","--wait"],"signature":"-w --wait","source_url":"/docs/18/app-pg-ctl.html","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."},{"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":["-W","--no-wait"],"signature":"-W --no-wait","source_url":"/docs/18/app-pg-ctl.html","summary":"Do not wait for the operation to complete. This is the opposite of the option -w ."},{"description":"Show help about pg_ctl command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-pg-ctl.html","summary":"Show help about pg_ctl command line arguments, and exit."},{"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":["-e source"],"signature":"-e source","source_url":"/docs/18/app-pg-ctl.html","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 ."},{"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":["-N servicename"],"signature":"-N servicename","source_url":"/docs/18/app-pg-ctl.html","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 ."},{"description":"Password for the user to run the service as.","names":["-P password"],"signature":"-P password","source_url":"/docs/18/app-pg-ctl.html","summary":"Password for the user to run the service as."},{"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":["-S start-type"],"signature":"-S start-type","source_url":"/docs/18/app-pg-ctl.html","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."},{"description":"User name for the user to run the service as. For domain users, use the format DOMAIN\\username .","names":["-U username"],"signature":"-U username","source_url":"/docs/18/app-pg-ctl.html","summary":"User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}],"related":[],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"sections_zh":[],"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 ]","sources":[{"anchor":"","file":"app-pg-ctl.html","label":"18.6 English manual · app-pg-ctl.html","sha256":"bf10289e73df34e48912e8612d5df29f8a8145a2250627d8c099ed59eae23339","url":"/docs/18/app-pg-ctl.html"},{"anchor":"","file":"reference-server.html","label":"Server applications inventory","sha256":"e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3","url":"/docs/18/reference-server.html"}],"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 ]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-c --core-files","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-D datadir --pgdata= datadir","url":"/docs/18/app-pg-ctl.html"},"summary":"Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."},{"signature":{"text":"-l filename --log= filename","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-m mode --mode= mode","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-o options --options= options","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-o initdb-options --options= initdb-options","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-p path","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-s --silent","url":"/docs/18/app-pg-ctl.html"},"summary":"Print only errors, no informational messages."},{"signature":{"text":"-t seconds --timeout= seconds","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-V --version","url":"/docs/18/app-pg-ctl.html"},"summary":"Print the pg_ctl version and exit."},{"signature":{"text":"-w --wait","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-W --no-wait","url":"/docs/18/app-pg-ctl.html"},"summary":"Do not wait for the operation to complete. This is the opposite of the option -w ."},{"signature":{"text":"-? --help","url":"/docs/18/app-pg-ctl.html"},"summary":"Show help about pg_ctl command line arguments, and exit."},{"signature":{"text":"-e source","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-N servicename","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-P password","url":"/docs/18/app-pg-ctl.html"},"summary":"Password for the user to run the service as."},{"signature":{"text":"-S start-type","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-U username","url":"/docs/18/app-pg-ctl.html"},"summary":"User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"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":"PGCTLTIMEOUT"},{"description":"Default data directory location.","name":"PGDATA"}],"title":"Environment variables"}],"tables_zh":[{"columns":[{"key":"signature","label":"选项与参数"},{"key":"summary","label":"说明"}],"key":"options","rows":[{"signature":{"text":"-c --core-files","url":"/docs/18/app-pg-ctl.html"},"summary":"在支持的平台上，通过解除对核心转储文件施加的任何软资源限制，尝试允许服务器在崩溃时生成核心转储文件。这样就可以从失败的服务器进程中获得栈跟踪，从而有助于调试或诊断问题。"},{"signature":{"text":"-D datadir --pgdata= datadir","url":"/docs/18/app-pg-ctl.html"},"summary":"指定数据库配置文件所在的文件系统位置。若省略此选项，则使用环境变量 PGDATA 。"},{"signature":{"text":"-l filename --log= filename","url":"/docs/18/app-pg-ctl.html"},"summary":"将服务器日志输出追加到 filename 。如果该文件不存在，就会创建它。默认情况下，只有集簇拥有者可以访问该日志文件。如果在集簇中启用了组访问权限，与集簇拥有者同组的用户也可以读取它。"},{"signature":{"text":"-m mode --mode= mode","url":"/docs/18/app-pg-ctl.html"},"summary":"指定关闭模式。 mode 可以是 smart 、 fast 或 immediate ，也可以是这三者之一的首字母。若省略此选项，则默认值为 fast 。"},{"signature":{"text":"-o options --options= options","url":"/docs/18/app-pg-ctl.html"},"summary":"指定要直接传递给 postgres 命令的选项。 -o 可以指定多次，给出的所有选项都会被传递过去。"},{"signature":{"text":"-o initdb-options --options= initdb-options","url":"/docs/18/app-pg-ctl.html"},"summary":"指定要直接传递给 initdb 命令的选项。 -o 可以指定多次，给出的所有选项都会被传递过去。"},{"signature":{"text":"-p path","url":"/docs/18/app-pg-ctl.html"},"summary":"指定 postgres 可执行程序的位置。默认情况下， postgres 可执行程序取自与 pg_ctl 相同的目录；如果那里没有，则取自硬编码的安装目录。除非采用了某些非常规方式，并收到找不到 postgres 可执行程序的错误，否则通常不需要使用此选项。"},{"signature":{"text":"-s --silent","url":"/docs/18/app-pg-ctl.html"},"summary":"只打印错误，不打印信息性消息。"},{"signature":{"text":"-t seconds --timeout= seconds","url":"/docs/18/app-pg-ctl.html"},"summary":"指定等待某个操作完成时最多等待多少秒（见选项 -w ）。默认值为环境变量 PGCTLTIMEOUT 的值；如果未设置该环境变量，则默认为 60 秒。"},{"signature":{"text":"-V --version","url":"/docs/18/app-pg-ctl.html"},"summary":"打印 pg_ctl 的版本并退出。"},{"signature":{"text":"-w --wait","url":"/docs/18/app-pg-ctl.html"},"summary":"等待操作完成。 start 、 stop 、 restart 、 promote 和 register 模式支持此选项，而且对这些模式来说它是默认行为。"},{"signature":{"text":"-W --no-wait","url":"/docs/18/app-pg-ctl.html"},"summary":"不等待操作完成。这与选项 -w 相反。"},{"signature":{"text":"-? --help","url":"/docs/18/app-pg-ctl.html"},"summary":"显示有关 pg_ctl 命令行参数的帮助并退出。"},{"signature":{"text":"-e source","url":"/docs/18/app-pg-ctl.html"},"summary":"指定以 Windows 服务方式运行时， pg_ctl 写入事件日志所使用的事件源名称。默认值为 PostgreSQL 。注意，这只控制由 pg_ctl 本身发送的消息；服务器一旦启动，就会使用其 event_source 参数指定的事件源。如果服务器在启动的很早阶段、该参数尚未设置之前就失败，它也可能使用默认事件源名称 PostgreSQL 记录日志。"},{"signature":{"text":"-N servicename","url":"/docs/18/app-pg-ctl.html"},"summary":"要注册的系统服务名称。该名称会同时用作服务名和显示名。默认值为 PostgreSQL 。"},{"signature":{"text":"-P password","url":"/docs/18/app-pg-ctl.html"},"summary":"用于运行该服务的用户密码。"},{"signature":{"text":"-S start-type","url":"/docs/18/app-pg-ctl.html"},"summary":"系统服务的启动类型。 start-type 可以是 auto 、 demand ，或者两者之一的首字母。若省略此选项，则默认值为 auto 。"},{"signature":{"text":"-U username","url":"/docs/18/app-pg-ctl.html"},"summary":"用于运行该服务的用户名。对于域用户，请使用 DOMAIN\\username 格式。"}],"title":"手册中的选项"},{"columns":[{"key":"name","label":"变量"},{"key":"description","label":"含义"}],"key":"environment","rows":[{"description":"等待启动或关闭完成时，默认的等待秒数上限。如果未设置，默认值为 60 秒。","name":"PGCTLTIMEOUT"},{"description":"默认数据目录位置。","name":"PGDATA"}],"title":"环境变量"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"ad673826b21f80363610ca027c3d819d24ec2837c37fd050d922264b12296629","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"command-description-and-options","fragment_sha256":"5a7c4b17c565b5c4be4faa335196f026bc8cf1ea7274e91b50544528fc36e58c","locale":"zh-Hans","page_key":"app-pg-ctl.html","source_hash":"38148dccfefaec286e24658b331b199984d29984deef1b573830ca99ff90b3b8","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/app-pg-ctl.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8"}},"ManualEvidence":{"manual_path":"app-pg-ctl.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"app-pg-ctl.html","label":"18.6 English manual · app-pg-ctl.html","sha256":"bf10289e73df34e48912e8612d5df29f8a8145a2250627d8c099ed59eae23339","url":"/docs/18/app-pg-ctl.html"},{"anchor":"","file":"reference-server.html","label":"Server applications inventory","sha256":"e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3","url":"/docs/18/reference-server.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"pg-ctl","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_ctl","Summary":"pg_ctl — initialize, start, stop, or control a PostgreSQL server","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-PG-CTL\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_ctl — initialize, start, stop, or control a \u003cspan\u003ePostgreSQL\u003c/span\u003e server\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.1\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003einit[db]\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-s\u003c/code\u003e] [\u003ccode\u003e-o\u003c/code\u003e \u003cem\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.2\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003estart\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-l\u003c/code\u003e \u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-W\u003c/code\u003e] [\u003ccode\u003e-t\u003c/code\u003e \u003cem\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-s\u003c/code\u003e] [\u003ccode\u003e-o\u003c/code\u003e \u003cem\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-p\u003c/code\u003e \u003cem\u003e\u003ccode\u003epath\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-c\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.3\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003estop\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-m\u003c/code\u003e \u003ccode\u003es[mart]\u003c/code\u003e | \u003ccode\u003ef[ast]\u003c/code\u003e | \u003ccode\u003ei[mmediate]\u003c/code\u003e ] [\u003ccode\u003e-W\u003c/code\u003e] [\u003ccode\u003e-t\u003c/code\u003e \u003cem\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.4\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003erestart\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-m\u003c/code\u003e \u003ccode\u003es[mart]\u003c/code\u003e | \u003ccode\u003ef[ast]\u003c/code\u003e | \u003ccode\u003ei[mmediate]\u003c/code\u003e ] [\u003ccode\u003e-W\u003c/code\u003e] [\u003ccode\u003e-t\u003c/code\u003e \u003cem\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-s\u003c/code\u003e] [\u003ccode\u003e-o\u003c/code\u003e \u003cem\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-c\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.5\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003ereload\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.6\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003estatus\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.7\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003epromote\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-W\u003c/code\u003e] [\u003ccode\u003e-t\u003c/code\u003e \u003cem\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.8\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003elogrotate\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.9\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003ekill\u003c/code\u003e \u003cem\u003e\u003ccode\u003esignal_name\u003c/code\u003e\u003c/em\u003e \u003cem\u003e\u003ccode\u003eprocess_id\u003c/code\u003e\u003c/em\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eOn Microsoft Windows, also:\u003c/p\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.11\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003eregister\u003c/code\u003e [\u003ccode\u003e-D\u003c/code\u003e \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-N\u003c/code\u003e \u003cem\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-U\u003c/code\u003e \u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-P\u003c/code\u003e \u003cem\u003e\u003ccode\u003epassword\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-S\u003c/code\u003e \u003ccode\u003ea[uto]\u003c/code\u003e | \u003ccode\u003ed[emand]\u003c/code\u003e ] [\u003ccode\u003e-e\u003c/code\u003e \u003cem\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-W\u003c/code\u003e] [\u003ccode\u003e-t\u003c/code\u003e \u003cem\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode\u003e-s\u003c/code\u003e] [\u003ccode\u003e-o\u003c/code\u003e \u003cem\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.5.8.4.12\"\u003e\u003ccode\u003epg_ctl\u003c/code\u003e \u003ccode\u003eunregister\u003c/code\u003e [\u003ccode\u003e-N\u003c/code\u003e \u003cem\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-PG-CTL-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003epg_ctl\u003c/span\u003e is a utility for initializing a \u003cspan\u003ePostgreSQL\u003c/span\u003e database cluster, starting, stopping, or restarting the \u003cspan\u003ePostgreSQL\u003c/span\u003e database server (\u003ca href=\"/docs/18/app-postgres.html\" title=\"postgres\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e), or displaying the status of a running server. Although the server can be started manually, \u003cspan\u003epg_ctl\u003c/span\u003e encapsulates tasks such as redirecting log output and properly detaching from the terminal and process group. It also provides convenient options for controlled shutdown.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode\u003einit\u003c/code\u003e or \u003ccode\u003einitdb\u003c/code\u003e mode creates a new \u003cspan\u003ePostgreSQL\u003c/span\u003e database cluster, that is, a collection of databases that will be managed by a single server instance. This mode invokes the \u003ccode\u003einitdb\u003c/code\u003e command. See \u003ca href=\"/docs/18/app-initdb.html\" title=\"initdb\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003einitdb\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for details.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003estart\u003c/code\u003e mode launches a new server. The server is started in the background, and its standard input is attached to \u003ccode\u003e/dev/null\u003c/code\u003e (or \u003ccode\u003enul\u003c/code\u003e on Windows). On Unix-like systems, by default, the server\u0026#39;s standard output and standard error are sent to \u003cspan\u003epg_ctl\u003c/span\u003e\u0026#39;s standard output (not standard error). The standard output of \u003cspan\u003epg_ctl\u003c/span\u003e should then be redirected to a file or piped to another process such as a log rotating program like \u003cspan\u003erotatelogs\u003c/span\u003e; otherwise \u003ccode\u003epostgres\u003c/code\u003e will write its output to the controlling terminal (from the background) and will not leave the shell\u0026#39;s process group. On Windows, by default the server\u0026#39;s standard output and standard error are sent to the terminal. These default behaviors can be changed by using \u003ccode\u003e-l\u003c/code\u003e to append the server\u0026#39;s output to a log file. Use of either \u003ccode\u003e-l\u003c/code\u003e or output redirection is recommended.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003estop\u003c/code\u003e mode shuts down the server that is running in the specified data directory. Three different shutdown methods can be selected with the \u003ccode\u003e-m\u003c/code\u003e option. \u003cspan\u003e“\u003cspan\u003eSmart\u003c/span\u003e”\u003c/span\u003e mode disallows new connections, then waits for all existing clients to disconnect. If the server is in hot standby, recovery and streaming replication will be terminated once all clients have disconnected. \u003cspan\u003e“\u003cspan\u003eFast\u003c/span\u003e”\u003c/span\u003e mode (the default) does not wait for clients to disconnect. All active transactions are rolled back and clients are forcibly disconnected, then the server is shut down. \u003cspan\u003e“\u003cspan\u003eImmediate\u003c/span\u003e”\u003c/span\u003e mode will abort all server processes immediately, without a clean shutdown. This choice will lead to a crash-recovery cycle during the next server start.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003erestart\u003c/code\u003e mode effectively executes a stop followed by a start. This allows changing the \u003ccode\u003epostgres\u003c/code\u003e command-line options, or changing configuration-file options that cannot be changed without restarting the server. If relative paths were used on the command line during server start, \u003ccode\u003erestart\u003c/code\u003e might fail unless \u003cspan\u003epg_ctl\u003c/span\u003e is executed in the same current directory as it was during server start.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003ereload\u003c/code\u003e mode simply sends the \u003ccode\u003epostgres\u003c/code\u003e server process a \u003cspan\u003eSIGHUP\u003c/span\u003e signal, causing it to reread its configuration files (\u003ccode\u003epostgresql.conf\u003c/code\u003e, \u003ccode\u003epg_hba.conf\u003c/code\u003e, etc.). This allows changing configuration-file options that do not require a full server restart to take effect.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003estatus\u003c/code\u003e mode checks whether a server is running in the specified data directory. If it is, the server\u0026#39;s PID and the command line options that were used to invoke it are displayed. If the server is not running, \u003cspan\u003epg_ctl\u003c/span\u003e returns an exit status of 3. If an accessible data directory is not specified, \u003cspan\u003epg_ctl\u003c/span\u003e returns an exit status of 4.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003epromote\u003c/code\u003e mode commands the standby server that is running in the specified data directory to end standby mode and begin read-write operations.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003elogrotate\u003c/code\u003e mode rotates the server log file. For details on how to use this mode with external log rotation tools, see \u003ca href=\"/docs/18/logfile-maintenance.html\" rel=\"nofollow\"\u003eSection 24.3\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003ekill\u003c/code\u003e mode sends a signal to a specified process. This is primarily valuable on \u003cspan\u003eMicrosoft Windows\u003c/span\u003e which does not have a built-in \u003cspan\u003ekill\u003c/span\u003e command. Use \u003ccode\u003e--help\u003c/code\u003e to see a list of supported signal names.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eregister\u003c/code\u003e mode registers the \u003cspan\u003ePostgreSQL\u003c/span\u003e server as a system service on \u003cspan\u003eMicrosoft Windows\u003c/span\u003e. The \u003ccode\u003e-S\u003c/code\u003e option allows selection of service start type, either \u003cspan\u003e“\u003cspan\u003eauto\u003c/span\u003e”\u003c/span\u003e (start service automatically on system startup) or \u003cspan\u003e“\u003cspan\u003edemand\u003c/span\u003e”\u003c/span\u003e (start service on demand).\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eunregister\u003c/code\u003e mode unregisters a system service on \u003cspan\u003eMicrosoft Windows\u003c/span\u003e. This undoes the effects of the \u003ccode\u003eregister\u003c/code\u003e command.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-PG-CTL-OPTIONS\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--core-files\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAttempt 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-D \u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--pgdata=\u003cem\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file system location of the database configuration files. If this option is omitted, the environment variable \u003ccode\u003ePGDATA\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-l \u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--log=\u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAppend the server log output to \u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-m \u003cem\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--mode=\u003cem\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the shutdown mode. \u003cem\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e can be \u003ccode\u003esmart\u003c/code\u003e, \u003ccode\u003efast\u003c/code\u003e, or \u003ccode\u003eimmediate\u003c/code\u003e, or the first letter of one of these three. If this option is omitted, \u003ccode\u003efast\u003c/code\u003e is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-o \u003cem\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--options=\u003cem\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies options to be passed directly to the \u003ccode\u003epostgres\u003c/code\u003e command. \u003ccode\u003e-o\u003c/code\u003e can be specified multiple times, with all the given options being passed through.\u003c/p\u003e\n\u003cp\u003eThe \u003cem\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e should usually be surrounded by single or double quotes to ensure that they are passed through as a group.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-o \u003cem\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--options=\u003cem\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies options to be passed directly to the \u003ccode\u003einitdb\u003c/code\u003e command. \u003ccode\u003e-o\u003c/code\u003e can be specified multiple times, with all the given options being passed through.\u003c/p\u003e\n\u003cp\u003eThe \u003cem\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e should usually be surrounded by single or double quotes to ensure that they are passed through as a group.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-p \u003cem\u003e\u003ccode\u003epath\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the location of the \u003ccode\u003epostgres\u003c/code\u003e executable. By default the \u003ccode\u003epostgres\u003c/code\u003e executable is taken from the same directory as \u003ccode\u003epg_ctl\u003c/code\u003e, 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 \u003ccode\u003epostgres\u003c/code\u003e executable was not found.\u003c/p\u003e\n\u003cp\u003eIn \u003ccode\u003einit\u003c/code\u003e mode, this option analogously specifies the location of the \u003ccode\u003einitdb\u003c/code\u003e executable.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--silent\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint only errors, no informational messages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-t \u003cem\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--timeout=\u003cem\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the maximum number of seconds to wait when waiting for an operation to complete (see option \u003ccode\u003e-w\u003c/code\u003e). Defaults to the value of the \u003ccode\u003ePGCTLTIMEOUT\u003c/code\u003e environment variable or, if not set, to 60 seconds.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan\u003epg_ctl\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--wait\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWait for the operation to complete. This is supported for the modes \u003ccode\u003estart\u003c/code\u003e, \u003ccode\u003estop\u003c/code\u003e, \u003ccode\u003erestart\u003c/code\u003e, \u003ccode\u003epromote\u003c/code\u003e, and \u003ccode\u003eregister\u003c/code\u003e, and is the default for those modes.\u003c/p\u003e\n\u003cp\u003eWhen waiting, \u003ccode\u003epg_ctl\u003c/code\u003e repeatedly checks the server\u0026#39;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. \u003ccode\u003epg_ctl\u003c/code\u003e returns an exit code based on the success of the startup or shutdown.\u003c/p\u003e\n\u003cp\u003eIf the operation does not complete within the timeout (see option \u003ccode\u003e-t\u003c/code\u003e), then \u003ccode\u003epg_ctl\u003c/code\u003e exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-wait\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not wait for the operation to complete. This is the opposite of the option \u003ccode\u003e-w\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eIf 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.\u003c/p\u003e\n\u003cp\u003eIn prior releases of PostgreSQL, this was the default except for the \u003ccode\u003estop\u003c/code\u003e mode.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan\u003epg_ctl\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eIf an option is specified that is valid, but not relevant to the selected operating mode, \u003cspan\u003epg_ctl\u003c/span\u003e ignores it.\u003c/p\u003e\n\u003cdiv id=\"APP-PG-CTL-WINDOWS-OPTIONS\"\u003e\n\u003ch3\u003eOptions for Windows\u003c/h3\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-e \u003cem\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eName of the event source for \u003cspan\u003epg_ctl\u003c/span\u003e to use for logging to the event log when running as a Windows service. The default is \u003ccode\u003ePostgreSQL\u003c/code\u003e. Note that this only controls messages sent from \u003cspan\u003epg_ctl\u003c/span\u003e itself; once started, the server will use the event source specified by its \u003ca href=\"/docs/18/runtime-config-logging.html#GUC-EVENT-SOURCE\" rel=\"nofollow\"\u003eevent_source\u003c/a\u003e 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 \u003ccode\u003ePostgreSQL\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-N \u003cem\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eName of the system service to register. This name will be used as both the service name and the display name. The default is \u003ccode\u003ePostgreSQL\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-P \u003cem\u003e\u003ccode\u003epassword\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePassword for the user to run the service as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-S \u003cem\u003e\u003ccode\u003estart-type\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eStart type of the system service. \u003cem\u003e\u003ccode\u003estart-type\u003c/code\u003e\u003c/em\u003e can be \u003ccode\u003eauto\u003c/code\u003e, or \u003ccode\u003edemand\u003c/code\u003e, or the first letter of one of these two. If this option is omitted, \u003ccode\u003eauto\u003c/code\u003e is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-U \u003cem\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name for the user to run the service as. For domain users, use the format \u003ccode\u003eDOMAIN\\username\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.8.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGCTLTIMEOUT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGDATA\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault data directory location.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eMost \u003ccode\u003epg_ctl\u003c/code\u003e modes require knowing the data directory location; therefore, the \u003ccode\u003e-D\u003c/code\u003e option is required unless \u003ccode\u003ePGDATA\u003c/code\u003e is set.\u003c/p\u003e\n\u003cp\u003eFor additional variables that affect the server, see \u003ca href=\"/docs/18/app-postgres.html\" title=\"postgres\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.8.8\"\u003e\n\u003ch2\u003eFiles\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003epostmaster.pid\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003e\u003cspan\u003epg_ctl\u003c/span\u003e examines this file in the data directory to determine whether the server is currently running.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003epostmaster.opts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf this file exists in the data directory, \u003cspan\u003epg_ctl\u003c/span\u003e (in \u003ccode\u003erestart\u003c/code\u003e mode) will pass the contents of the file as options to \u003cspan\u003epostgres\u003c/span\u003e, unless overridden by the \u003ccode\u003e-o\u003c/code\u003e option. The contents of this file are also displayed in \u003ccode\u003estatus\u003c/code\u003e mode.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"R1-APP-PGCTL-2\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cdiv id=\"R2-APP-PGCTL-3\"\u003e\n\u003ch3\u003eStarting the Server\u003c/h3\u003e\n\u003cp\u003eTo start the server, waiting until the server is accepting connections:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epg_ctl start\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo start the server using port 5433, and running without \u003ccode\u003efsync\u003c/code\u003e, use:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epg_ctl -o \u0026#34;-F -p 5433\u0026#34; start\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv id=\"R2-APP-PGCTL-4\"\u003e\n\u003ch3\u003eStopping the Server\u003c/h3\u003e\n\u003cp\u003eTo stop the server, use:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epg_ctl stop\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode\u003e-m\u003c/code\u003e option allows control over \u003cspan\u003e\u003cem\u003ehow\u003c/em\u003e\u003c/span\u003e the server shuts down:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epg_ctl stop -m smart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv id=\"R2-APP-PGCTL-5\"\u003e\n\u003ch3\u003eRestarting the Server\u003c/h3\u003e\n\u003cp\u003eRestarting the server is almost equivalent to stopping the server and starting it again, except that by default, \u003ccode\u003epg_ctl\u003c/code\u003e saves and reuses the command line options that were passed to the previously-running instance. To restart the server using the same options as before, use:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epg_ctl restart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eBut if \u003ccode\u003e-o\u003c/code\u003e is specified, that replaces any previous options. To restart using port 5433, disabling \u003ccode\u003efsync\u003c/code\u003e upon restart:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epg_ctl -o \u0026#34;-F -p 5433\u0026#34; restart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv id=\"R2-APP-PGCTL-6\"\u003e\n\u003ch3\u003eShowing the Server Status\u003c/h3\u003e\n\u003cp\u003eHere is sample status output from \u003cspan\u003epg_ctl\u003c/span\u003e:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epg_ctl status\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003e\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \u0026#34;-D\u0026#34; \u0026#34;/usr/local/pgsql/data\u0026#34; \u0026#34;-p\u0026#34; \u0026#34;5433\u0026#34; \u0026#34;-B\u0026#34; \u0026#34;128\u0026#34;\n\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe second line is the command that would be invoked in restart mode.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.8.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/docs/18/app-initdb.html\" title=\"initdb\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003einitdb\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003ca href=\"/docs/18/app-postgres.html\" title=\"postgres\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"5470aeaffd7749ae39c5ee278070f7749fe0e54575205315620f6293bb094a7b","Payload":{"description":["pg_ctl — initialize, start, stop, or control a PostgreSQL server"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PG-CTL\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_ctl — initialize, start, stop, or control a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e server\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.1\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003einit[db]\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-o\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.2\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003estart\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-l\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-o\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-p\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003epath\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-c\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.3\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003estop\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-m\u003c/code\u003e \u003ccode class=\"option\"\u003es[mart]\u003c/code\u003e | \u003ccode class=\"option\"\u003ef[ast]\u003c/code\u003e | \u003ccode class=\"option\"\u003ei[mmediate]\u003c/code\u003e ] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.4\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003erestart\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-m\u003c/code\u003e \u003ccode class=\"option\"\u003es[mart]\u003c/code\u003e | \u003ccode class=\"option\"\u003ef[ast]\u003c/code\u003e | \u003ccode class=\"option\"\u003ei[mmediate]\u003c/code\u003e ] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-o\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-c\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.5\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003ereload\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.6\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003estatus\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.7\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003epromote\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.8\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003elogrotate\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.9\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003ekill\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esignal_name\u003c/code\u003e\u003c/em\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eprocess_id\u003c/code\u003e\u003c/em\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003cp\u003eOn Microsoft Windows, also:\u003c/p\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.11\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003eregister\u003c/code\u003e [\u003ccode class=\"option\"\u003e-D\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-N\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-U\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-P\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003epassword\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-S\u003c/code\u003e \u003ccode class=\"option\"\u003ea[uto]\u003c/code\u003e | \u003ccode class=\"option\"\u003ed[emand]\u003c/code\u003e ] [\u003ccode class=\"option\"\u003e-e\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-W\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e] [\u003ccode class=\"option\"\u003e-s\u003c/code\u003e] [\u003ccode class=\"option\"\u003e-o\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.5.8.4.12\"\u003e\u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e \u003ccode class=\"option\"\u003eunregister\u003c/code\u003e [\u003ccode class=\"option\"\u003e-N\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PG-CTL-DESCRIPTION\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e is a utility for initializing a \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database cluster, starting, stopping, or restarting the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database server (\u003ca class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e), or displaying the status of a running server. Although the server can be started manually, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e encapsulates tasks such as redirecting log output and properly detaching from the terminal and process group. It also provides convenient options for controlled shutdown.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003einit\u003c/code\u003e or \u003ccode class=\"option\"\u003einitdb\u003c/code\u003e mode creates a new \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database cluster, that is, a collection of databases that will be managed by a single server instance. This mode invokes the \u003ccode class=\"command\"\u003einitdb\u003c/code\u003e command. See \u003ca class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003einitdb\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e for details.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003estart\u003c/code\u003e mode launches a new server. The server is started in the background, and its standard input is attached to \u003ccode class=\"filename\"\u003e/dev/null\u003c/code\u003e (or \u003ccode class=\"literal\"\u003enul\u003c/code\u003e on Windows). On Unix-like systems, by default, the server's standard output and standard error are sent to \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e's standard output (not standard error). The standard output of \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e should then be redirected to a file or piped to another process such as a log rotating program like \u003cspan class=\"application\"\u003erotatelogs\u003c/span\u003e; otherwise \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e will write its output to the controlling terminal (from the background) and will not leave the shell's process group. On Windows, by default the server's standard output and standard error are sent to the terminal. These default behaviors can be changed by using \u003ccode class=\"option\"\u003e-l\u003c/code\u003e to append the server's output to a log file. Use of either \u003ccode class=\"option\"\u003e-l\u003c/code\u003e or output redirection is recommended.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003estop\u003c/code\u003e mode shuts down the server that is running in the specified data directory. Three different shutdown methods can be selected with the \u003ccode class=\"option\"\u003e-m\u003c/code\u003e option. \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eSmart\u003c/span\u003e”\u003c/span\u003e mode disallows new connections, then waits for all existing clients to disconnect. If the server is in hot standby, recovery and streaming replication will be terminated once all clients have disconnected. \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eFast\u003c/span\u003e”\u003c/span\u003e mode (the default) does not wait for clients to disconnect. All active transactions are rolled back and clients are forcibly disconnected, then the server is shut down. \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eImmediate\u003c/span\u003e”\u003c/span\u003e mode will abort all server processes immediately, without a clean shutdown. This choice will lead to a crash-recovery cycle during the next server start.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003erestart\u003c/code\u003e mode effectively executes a stop followed by a start. This allows changing the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e command-line options, or changing configuration-file options that cannot be changed without restarting the server. If relative paths were used on the command line during server start, \u003ccode class=\"option\"\u003erestart\u003c/code\u003e might fail unless \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e is executed in the same current directory as it was during server start.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003ereload\u003c/code\u003e mode simply sends the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server process a \u003cspan class=\"systemitem\"\u003eSIGHUP\u003c/span\u003e signal, causing it to reread its configuration files (\u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e, \u003ccode class=\"filename\"\u003epg_hba.conf\u003c/code\u003e, etc.). This allows changing configuration-file options that do not require a full server restart to take effect.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003estatus\u003c/code\u003e mode checks whether a server is running in the specified data directory. If it is, the server's PID and the command line options that were used to invoke it are displayed. If the server is not running, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e returns an exit status of 3. If an accessible data directory is not specified, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e returns an exit status of 4.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003epromote\u003c/code\u003e mode commands the standby server that is running in the specified data directory to end standby mode and begin read-write operations.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003elogrotate\u003c/code\u003e mode rotates the server log file. For details on how to use this mode with external log rotation tools, see \u003ca class=\"xref\" href=\"/docs/18/logfile-maintenance.html\" title=\"24.3. Log File Maintenance\"\u003eSection 24.3\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003ekill\u003c/code\u003e mode sends a signal to a specified process. This is primarily valuable on \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e which does not have a built-in \u003cspan class=\"application\"\u003ekill\u003c/span\u003e command. Use \u003ccode class=\"literal\"\u003e--help\u003c/code\u003e to see a list of supported signal names.\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003eregister\u003c/code\u003e mode registers the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e server as a system service on \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e. The \u003ccode class=\"option\"\u003e-S\u003c/code\u003e option allows selection of service start type, either \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eauto\u003c/span\u003e”\u003c/span\u003e (start service automatically on system startup) or \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edemand\u003c/span\u003e”\u003c/span\u003e (start service on demand).\u003c/p\u003e\n\u003cp\u003e\u003ccode class=\"option\"\u003eunregister\u003c/code\u003e mode unregisters a system service on \u003cspan class=\"productname\"\u003eMicrosoft Windows\u003c/span\u003e. This undoes the effects of the \u003ccode class=\"option\"\u003eregister\u003c/code\u003e command.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PG-CTL-OPTIONS\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--core-files\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAttempt 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-D \u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--pgdata=\u003cem class=\"replaceable\"\u003e\u003ccode\u003edatadir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file system location of the database configuration files. If this option is omitted, the environment variable \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--log=\u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAppend the server log output to \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. 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.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-m \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--mode=\u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the shutdown mode. \u003cem class=\"replaceable\"\u003e\u003ccode\u003emode\u003c/code\u003e\u003c/em\u003e can be \u003ccode class=\"literal\"\u003esmart\u003c/code\u003e, \u003ccode class=\"literal\"\u003efast\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eimmediate\u003c/code\u003e, or the first letter of one of these three. If this option is omitted, \u003ccode class=\"literal\"\u003efast\u003c/code\u003e is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--options=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies options to be passed directly to the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e command. \u003ccode class=\"option\"\u003e-o\u003c/code\u003e can be specified multiple times, with all the given options being passed through.\u003c/p\u003e\n\u003cp\u003eThe \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoptions\u003c/code\u003e\u003c/em\u003e should usually be surrounded by single or double quotes to ensure that they are passed through as a group.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--options=\u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies options to be passed directly to the \u003ccode class=\"command\"\u003einitdb\u003c/code\u003e command. \u003ccode class=\"option\"\u003e-o\u003c/code\u003e can be specified multiple times, with all the given options being passed through.\u003c/p\u003e\n\u003cp\u003eThe \u003cem class=\"replaceable\"\u003e\u003ccode\u003einitdb-options\u003c/code\u003e\u003c/em\u003e should usually be surrounded by single or double quotes to ensure that they are passed through as a group.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003epath\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the location of the \u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e executable. By default the \u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e executable is taken from the same directory as \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e, 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 \u003ccode class=\"filename\"\u003epostgres\u003c/code\u003e executable was not found.\u003c/p\u003e\n\u003cp\u003eIn \u003ccode class=\"literal\"\u003einit\u003c/code\u003e mode, this option analogously specifies the location of the \u003ccode class=\"filename\"\u003einitdb\u003c/code\u003e executable.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--silent\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint only errors, no informational messages.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--timeout=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the maximum number of seconds to wait when waiting for an operation to complete (see option \u003ccode class=\"option\"\u003e-w\u003c/code\u003e). Defaults to the value of the \u003ccode class=\"envar\"\u003ePGCTLTIMEOUT\u003c/code\u003e environment variable or, if not set, to 60 seconds.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint the \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-w\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--wait\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWait for the operation to complete. This is supported for the modes \u003ccode class=\"literal\"\u003estart\u003c/code\u003e, \u003ccode class=\"literal\"\u003estop\u003c/code\u003e, \u003ccode class=\"literal\"\u003erestart\u003c/code\u003e, \u003ccode class=\"literal\"\u003epromote\u003c/code\u003e, and \u003ccode class=\"literal\"\u003eregister\u003c/code\u003e, and is the default for those modes.\u003c/p\u003e\n\u003cp\u003eWhen waiting, \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e 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. \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e returns an exit code based on the success of the startup or shutdown.\u003c/p\u003e\n\u003cp\u003eIf the operation does not complete within the timeout (see option \u003ccode class=\"option\"\u003e-t\u003c/code\u003e), then \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-wait\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDo not wait for the operation to complete. This is the opposite of the option \u003ccode class=\"option\"\u003e-w\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eIf 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.\u003c/p\u003e\n\u003cp\u003eIn prior releases of PostgreSQL, this was the default except for the \u003ccode class=\"literal\"\u003estop\u003c/code\u003e mode.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShow help about \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eIf an option is specified that is valid, but not relevant to the selected operating mode, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e ignores it.\u003c/p\u003e\n\u003cdiv class=\"refsect2\" id=\"APP-PG-CTL-WINDOWS-OPTIONS\"\u003e\n\u003ch3\u003eOptions for Windows\u003c/h3\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esource\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eName of the event source for \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e to use for logging to the event log when running as a Windows service. The default is \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e. Note that this only controls messages sent from \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e itself; once started, the server will use the event source specified by its \u003ca class=\"xref\" href=\"/docs/18/runtime-config-logging.html#GUC-EVENT-SOURCE\"\u003eevent_source\u003c/a\u003e 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 \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N \u003cem class=\"replaceable\"\u003e\u003ccode\u003eservicename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eName of the system service to register. This name will be used as both the service name and the display name. The default is \u003ccode class=\"literal\"\u003ePostgreSQL\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P \u003cem class=\"replaceable\"\u003e\u003ccode\u003epassword\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePassword for the user to run the service as.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S \u003cem class=\"replaceable\"\u003e\u003ccode\u003estart-type\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eStart type of the system service. \u003cem class=\"replaceable\"\u003e\u003ccode\u003estart-type\u003c/code\u003e\u003c/em\u003e can be \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e, or \u003ccode class=\"literal\"\u003edemand\u003c/code\u003e, or the first letter of one of these two. If this option is omitted, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e is the default.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-U \u003cem class=\"replaceable\"\u003e\u003ccode\u003eusername\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUser name for the user to run the service as. For domain users, use the format \u003ccode class=\"literal\"\u003eDOMAIN\\username\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.8.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGCTLTIMEOUT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault data directory location.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cp\u003eMost \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e modes require knowing the data directory location; therefore, the \u003ccode class=\"option\"\u003e-D\u003c/code\u003e option is required unless \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e is set.\u003c/p\u003e\n\u003cp\u003eFor additional variables that affect the server, see \u003ca class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.8.8\"\u003e\n\u003ch2\u003eFiles\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"filename\"\u003epostmaster.pid\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e examines this file in the data directory to determine whether the server is currently running.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"filename\"\u003epostmaster.opts\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIf this file exists in the data directory, \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e (in \u003ccode class=\"option\"\u003erestart\u003c/code\u003e mode) will pass the contents of the file as options to \u003cspan class=\"application\"\u003epostgres\u003c/span\u003e, unless overridden by the \u003ccode class=\"option\"\u003e-o\u003c/code\u003e option. The contents of this file are also displayed in \u003ccode class=\"option\"\u003estatus\u003c/code\u003e mode.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"R1-APP-PGCTL-2\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cdiv class=\"refsect2\" id=\"R2-APP-PGCTL-3\"\u003e\n\u003ch3\u003eStarting the Server\u003c/h3\u003e\n\u003cp\u003eTo start the server, waiting until the server is accepting connections:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl start\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo start the server using port 5433, and running without \u003ccode class=\"function\"\u003efsync\u003c/code\u003e, use:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl -o \"-F -p 5433\" start\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"R2-APP-PGCTL-4\"\u003e\n\u003ch3\u003eStopping the Server\u003c/h3\u003e\n\u003cp\u003eTo stop the server, use:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl stop\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003e-m\u003c/code\u003e option allows control over \u003cspan class=\"emphasis\"\u003e\u003cem\u003ehow\u003c/em\u003e\u003c/span\u003e the server shuts down:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl stop -m smart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"R2-APP-PGCTL-5\"\u003e\n\u003ch3\u003eRestarting the Server\u003c/h3\u003e\n\u003cp\u003eRestarting the server is almost equivalent to stopping the server and starting it again, except that by default, \u003ccode class=\"command\"\u003epg_ctl\u003c/code\u003e saves and reuses the command line options that were passed to the previously-running instance. To restart the server using the same options as before, use:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl restart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eBut if \u003ccode class=\"option\"\u003e-o\u003c/code\u003e is specified, that replaces any previous options. To restart using port 5433, disabling \u003ccode class=\"function\"\u003efsync\u003c/code\u003e upon restart:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl -o \"-F -p 5433\" restart\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"R2-APP-PGCTL-6\"\u003e\n\u003ch3\u003eShowing the Server Status\u003c/h3\u003e\n\u003cp\u003eHere is sample status output from \u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epg_ctl status\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"computeroutput\"\u003e\npg_ctl: server is running (PID: 13718)\n/usr/local/pgsql/bin/postgres \"-D\" \"/usr/local/pgsql/data\" \"-p\" \"5433\" \"-B\" \"128\"\n\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003eThe second line is the command that would be invoked in restart mode.\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.8.10\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/app-initdb.html\" title=\"initdb\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003einitdb\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003ca class=\"xref\" href=\"/docs/18/app-postgres.html\" title=\"postgres\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-c --core-files","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-D datadir --pgdata= datadir","url":"/docs/18/app-pg-ctl.html"},"summary":"Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used."},{"signature":{"text":"-l filename --log= filename","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-m mode --mode= mode","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-o options --options= options","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-o initdb-options --options= initdb-options","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-p path","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-s --silent","url":"/docs/18/app-pg-ctl.html"},"summary":"Print only errors, no informational messages."},{"signature":{"text":"-t seconds --timeout= seconds","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-V --version","url":"/docs/18/app-pg-ctl.html"},"summary":"Print the pg_ctl version and exit."},{"signature":{"text":"-w --wait","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-W --no-wait","url":"/docs/18/app-pg-ctl.html"},"summary":"Do not wait for the operation to complete. This is the opposite of the option -w ."},{"signature":{"text":"-? --help","url":"/docs/18/app-pg-ctl.html"},"summary":"Show help about pg_ctl command line arguments, and exit."},{"signature":{"text":"-e source","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-N servicename","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-P password","url":"/docs/18/app-pg-ctl.html"},"summary":"Password for the user to run the service as."},{"signature":{"text":"-S start-type","url":"/docs/18/app-pg-ctl.html"},"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":{"text":"-U username","url":"/docs/18/app-pg-ctl.html"},"summary":"User name for the user to run the service as. For domain users, use the format DOMAIN\\username ."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"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":"PGCTLTIMEOUT"},{"description":"Default data directory location.","name":"PGDATA"}],"title":"Environment variables"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
