{"Entry":{"collection":"tool","key":"postgres","name":"postgres","aliases":["postgres"],"metadata":{"aliases":["postgres"],"category":"Server applications","content_hash":"2a052b09c42028fa2662c482d2d61c89c1050f1404a262f1a4705d3820b2cc88","imported_at":"2026-09-30T00:40:34.589868+08:00","name":"postgres","name_zh":"","slug":"postgres","summary":"postgres — PostgreSQL database server"}},"Definition":{"Collection":"tool","Key":"postgres","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"postgres","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[{"description":"Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.","name":"PGCLIENTENCODING"},{"description":"Default data directory location","name":"PGDATA"},{"description":"Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)","name":"PGDATESTYLE"},{"description":"Default port number (preferably set in the configuration file)","name":"PGPORT"}],"options":[{"description":"Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.","names":["-B nbuffers"],"signature":"-B nbuffers"},{"description":"Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.","names":["-c name = value"],"signature":"-c name = value"},{"description":"Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view.","names":["-C name"],"signature":"-C name"},{"description":"Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.","names":["-d debug-level"],"signature":"-d debug-level"},{"description":"Specifies the file system location of the database configuration files. See Section 19.2 for details.","names":["-D datadir"],"signature":"-D datadir"},{"description":"Sets the default date style to “ European ” , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.","names":["-e"],"signature":"-e"},{"description":"Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!","names":["-F"],"signature":"-F"},{"description":"Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.","names":["-h hostname"],"signature":"-h hostname"},{"description":"Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly.","names":["-i"],"signature":"-i"},{"description":"Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.","names":["-k directory"],"signature":"-k directory"},{"description":"Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .","names":["-l"],"signature":"-l"},{"description":"Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.","names":["-N max-connections"],"signature":"-N max-connections"},{"description":"Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .","names":["-p port"],"signature":"-p port"},{"description":"Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.","names":["-s"],"signature":"-s"},{"description":"Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .","names":["-S"],"signature":"-S work-mem"},{"description":"Print the postgres version and exit.","names":["-V","--version"],"signature":"-V --version"},{"description":"Sets a named run-time parameter; a shorter form of -c .","names":["-- name = value"],"signature":"-- name = value"},{"description":"This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.","names":["--describe-config"],"signature":"--describe-config"},{"description":"Show help about postgres command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help"},{"description":"Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative.","names":["-f"],"signature":"-f { s | i | o | b | t | n | m | h }"},{"description":"Allows the structure of system tables to be modified. This is used by initdb .","names":["-O"],"signature":"-O"},{"description":"Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.","names":["-P"],"signature":"-P"},{"description":"Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.","names":["-t"],"signature":"-t pa[rser] | pl[anner] | e[xecutor]"},{"description":"This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.","names":["-T"],"signature":"-T"},{"description":"Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.","names":["-v"],"signature":"-v protocol"},{"description":"A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.","names":["-W"],"signature":"-W seconds"},{"description":"Selects the single-user mode. This must be the first argument on the command line.","names":["--single"],"signature":"--single"},{"description":"Echo all commands to standard output before executing them.","names":["-E"],"signature":"-E"},{"description":"Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.","names":["-j"],"signature":"-j"},{"description":"Send all server log output to filename . This option is only honored when supplied as a command-line option.","names":["-r"],"signature":"-r filename"}],"synopsis":["postgres [ option ...]"]},"comparison_hash":"30509748ef5aa6efd93c214ffb28fb9023e0efecf59598655674d069faddb18d","description":["postgres — PostgreSQL database server"],"environment":[{"description":"Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.","name":"PGCLIENTENCODING"},{"description":"Default data directory location","name":"PGDATA"},{"description":"Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)","name":"PGDATESTYLE"},{"description":"Default port number (preferably set in the configuration file)","name":"PGPORT"}],"facts":[{"label":"Documented executable","value":"postgres"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Server applications"},{"label":"Option definition groups","value":"30"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-POSTGRES\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epostgres — \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database 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.16.4.1\"\u003e\u003ccode class=\"command\"\u003epostgres\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.16.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003epostgres\u003c/code\u003e is the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database server. In order for a client application to access a database it connects (over a network or locally) to a running \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e instance. The \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e instance then starts a separate server process to handle the connection.\u003c/p\u003e\n\u003cp\u003eOne \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e instance always manages the data of exactly one database cluster. A database cluster is a collection of databases that is stored at a common file system location (the \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edata area\u003c/span\u003e”\u003c/span\u003e). More than one \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e instance can run on a system at one time, so long as they use different data areas and different communication ports (see below). When \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e starts it needs to know the location of the data area. The location must be specified by the \u003ccode class=\"option\"\u003e-D\u003c/code\u003e option or the \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e environment variable; there is no default. Typically, \u003ccode class=\"option\"\u003e-D\u003c/code\u003e or \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e points directly to the data area directory created by \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. Other possible file layouts are discussed in \u003ca class=\"xref\" href=\"/docs/18/runtime-config-file-locations.html\" title=\"19.2. File Locations\"\u003eSection 19.2\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eBy default \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e starts in the foreground and prints log messages to the standard error stream. In practical applications \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e should be started as a background process, perhaps at boot time.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e command can also be called in single-user mode. The primary use for this mode is during bootstrapping by \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. Sometimes it is used for debugging or disaster recovery; note that running a single-user server is not truly suitable for debugging the server, since no realistic interprocess communication and locking will happen. When invoked in single-user mode from the shell, the user can enter queries and the results will be printed to the screen, but in a form that is more useful for developers than end users. In the single-user mode, the session user will be set to the user with ID 1, and implicit superuser powers are granted to this user. This user does not actually have to exist, so the single-user mode can be used to manually recover from certain kinds of accidental damage to the system catalogs.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003epostgres\u003c/code\u003e accepts the following command-line arguments. For a detailed discussion of the options consult \u003ca class=\"xref\" href=\"/docs/18/runtime-config.html\" title=\"Chapter 19. Server Configuration\"\u003eChapter 19\u003c/a\u003e. You can save typing most of these options by setting up a configuration file. Some (safe) options can also be set from the connecting client in an application-dependent way to apply only for that session. For example, if the environment variable \u003ccode class=\"envar\"\u003ePGOPTIONS\u003c/code\u003e is set, then \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e-based clients will pass that string to the server, which will interpret it as \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e command-line options.\u003c/p\u003e\n\u003cdiv class=\"refsect2\" id=\"id-1.9.5.16.6.3\"\u003e\n\u003ch3\u003eGeneral Purpose\u003c/h3\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-B \u003cem class=\"replaceable\"\u003e\u003ccode\u003enbuffers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by \u003cspan class=\"application\"\u003einitdb\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\"\u003eshared_buffers\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e=\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets a named run-time parameter. The configuration parameters supported by \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e are described in \u003ca class=\"xref\" href=\"/docs/18/runtime-config.html\" title=\"Chapter 19. Server Configuration\"\u003eChapter 19\u003c/a\u003e. Most of the other command line options are in fact short forms of such a parameter assignment. \u003ccode class=\"option\"\u003e-c\u003c/code\u003e can appear multiple times to set multiple parameters.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-C \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrints the value of the named run-time parameter, and exits. (See the \u003ccode class=\"option\"\u003e-c\u003c/code\u003e option above for details.) This returns values from \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e, modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.\u003c/p\u003e\n\u003cp\u003eThis can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., \u003ca class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\"\u003eshared_memory_size\u003c/a\u003e, \u003ca class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\"\u003eshared_memory_size_in_huge_pages\u003c/a\u003e, and \u003ca class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\"\u003ewal_segment_size\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eThis option is meant for other programs that interact with a server instance, such as \u003ca class=\"xref\" href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, to query configuration parameter values. User-facing applications should instead use \u003ca class=\"link\" href=\"/docs/18/sql-show.html\" title=\"SHOW\"\u003e\u003ccode class=\"command\"\u003eSHOW\u003c/code\u003e\u003c/a\u003e or the \u003ccode class=\"structname\"\u003epg_settings\u003c/code\u003e view.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d \u003cem class=\"replaceable\"\u003e\u003ccode\u003edebug-level\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass \u003ccode class=\"literal\"\u003e-d 0\u003c/code\u003e for a specific session, which will prevent the server log level of the parent \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e process from being propagated to this session.\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\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file system location of the database configuration files. See \u003ca class=\"xref\" href=\"/docs/18/runtime-config-file-locations.html\" title=\"19.2. File Locations\"\u003eSection 19.2\u003c/a\u003e for details.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the default date style to \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eEuropean\u003c/span\u003e”\u003c/span\u003e, that is \u003ccode class=\"literal\"\u003eDMY\u003c/code\u003e ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See \u003ca class=\"xref\" href=\"/docs/18/datatype-datetime.html\" title=\"8.5. Date/Time Types\"\u003eSection 8.5\u003c/a\u003e for more information.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-F\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables \u003ccode class=\"function\"\u003efsync\u003c/code\u003e calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-FSYNC\"\u003efsync\u003c/a\u003e configuration parameter. Read the detailed documentation before using this!\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehostname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the IP host name or address on which \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or \u003ccode class=\"literal\"\u003e*\u003c/code\u003e to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on \u003cspan class=\"systemitem\"\u003elocalhost\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\"\u003elisten_addresses\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting \u003ccode class=\"varname\"\u003elisten_addresses\u003c/code\u003e to \u003ccode class=\"literal\"\u003e*\u003c/code\u003e in \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e or via \u003ccode class=\"option\"\u003e-h\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option is deprecated since it does not allow access to the full functionality of \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\"\u003elisten_addresses\u003c/a\u003e. It's usually better to set \u003ccode class=\"varname\"\u003elisten_addresses\u003c/code\u003e directly.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-k \u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory of the Unix-domain socket on which \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally \u003ccode class=\"filename\"\u003e/tmp\u003c/code\u003e, but that can be changed at build time. Specifying this option is equivalent to setting the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\"\u003eunix_socket_directories\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnables secure connections using SSL. \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e must have been compiled with support for SSL for this option to be available. For more information on using SSL, refer to \u003ca class=\"xref\" href=\"/docs/18/ssl-tcp.html\" title=\"18.9. Secure TCP/IP Connections with SSL\"\u003eSection 18.9\u003c/a\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\u003emax-connections\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by \u003cspan class=\"application\"\u003einitdb\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP/IP port or local Unix domain socket file extension on which \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e is to listen for connections from client applications. Defaults to the value of the \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e environment variable, or if \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003ework-mem\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the \u003ccode class=\"varname\"\u003ework_mem\u003c/code\u003e configuration parameter in \u003ca class=\"xref\" href=\"/docs/18/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1. Memory\"\u003eSection 19.4.1\u003c/a\u003e.\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\"\u003epostgres\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e=\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets a named run-time parameter; a shorter form of \u003ccode class=\"option\"\u003e-c\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--describe-config\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e format. It is designed primarily for use by administration tools.\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\"\u003epostgres\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"id-1.9.5.16.6.4\"\u003e\n\u003ch3\u003eSemi-Internal Options\u003c/h3\u003e\n\u003cp\u003eThe options described here are used mainly for debugging purposes, and in some cases to assist with recovery of severely damaged databases. There should be no reason to use them in a production database setup. They are listed here only for use by \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e system developers. Furthermore, these options might change or be removed in a future release without notice.\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f\u003c/code\u003e \u003ccode class=\"literal\"\u003e{ s | i | o | b | t | n | m | h }\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForbids the use of particular scan and join methods: \u003ccode class=\"literal\"\u003es\u003c/code\u003e and \u003ccode class=\"literal\"\u003ei\u003c/code\u003e disable sequential and index scans respectively, \u003ccode class=\"literal\"\u003eo\u003c/code\u003e, \u003ccode class=\"literal\"\u003eb\u003c/code\u003e and \u003ccode class=\"literal\"\u003et\u003c/code\u003e disable index-only scans, bitmap index scans, and TID scans respectively, while \u003ccode class=\"literal\"\u003en\u003c/code\u003e, \u003ccode class=\"literal\"\u003em\u003c/code\u003e, and \u003ccode class=\"literal\"\u003eh\u003c/code\u003e disable nested-loop, merge and hash joins respectively.\u003c/p\u003e\n\u003cp\u003eNeither sequential scans nor nested-loop joins can be disabled completely; the \u003ccode class=\"literal\"\u003e-fs\u003c/code\u003e and \u003ccode class=\"literal\"\u003e-fn\u003c/code\u003e options simply discourage the optimizer from using those plan types if it has any other alternative.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-O\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows the structure of system tables to be modified. This is used by \u003ccode class=\"command\"\u003einitdb\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIgnore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003ccode class=\"literal\"\u003epa[rser] | pl[anner] | e[xecutor]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint timing statistics for each query relating to each of the major system modules. This option cannot be used together with the \u003ccode class=\"option\"\u003e-s\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-T\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them \u003cspan class=\"systemitem\"\u003eSIGQUIT\u003c/span\u003e signals. With this option, \u003cspan class=\"systemitem\"\u003eSIGABRT\u003c/span\u003e will be sent instead, resulting in production of core dump files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eprotocol\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eA delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"id-1.9.5.16.6.5\"\u003e\n\u003ch3\u003eOptions for Single-User Mode\u003c/h3\u003e\n\u003cp\u003eThe following options only apply to the single-user mode (see \u003ca class=\"xref\" href=\"/docs/18/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"Single-User Mode\"\u003eSingle-User Mode\u003c/a\u003e below).\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--single\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSelects the single-user mode. This must be the first argument on the command line.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003edatabase\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to be accessed. This must be the last argument on the command line. If it is omitted it defaults to the user name.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-E\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho all commands to standard output before executing them.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-j\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse semicolon followed by two newlines, rather than just newline, as the command entry terminator.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSend all server log output to \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. This option is only honored when supplied as a command-line option.\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.16.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\"\u003ePGCLIENTENCODING\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.\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\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGDATESTYLE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault value of the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-DATESTYLE\"\u003eDateStyle\u003c/a\u003e run-time parameter. (The use of this environment variable is deprecated.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault port number (preferably set in the configuration file)\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.16.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eA failure message mentioning \u003ccode class=\"literal\"\u003esemget\u003c/code\u003e or \u003ccode class=\"literal\"\u003eshmget\u003c/code\u003e probably indicates you need to configure your kernel to provide adequate shared memory and semaphores. For more discussion see \u003ca class=\"xref\" href=\"/docs/18/kernel-resources.html\" title=\"18.4. Managing Kernel Resources\"\u003eSection 18.4\u003c/a\u003e. You might be able to postpone reconfiguring your kernel by decreasing \u003ca class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\"\u003eshared_buffers\u003c/a\u003e to reduce the shared memory consumption of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e, and/or by reducing \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e to reduce the semaphore consumption.\u003c/p\u003e\n\u003cp\u003eA failure message suggesting that another server is already running should be checked carefully, for example by using the command\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003eps ax | grep postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eor\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003eps -ef | grep postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003edepending on your system. If you are certain that no conflicting server is running, you can remove the lock file mentioned in the message and try again.\u003c/p\u003e\n\u003cp\u003eA failure message indicating inability to bind to a port might indicate that that port is already in use by some non-\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e process. You might also get this error if you terminate \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e and immediately restart it using the same port; in this case, you must simply wait a few seconds until the operating system closes the port before trying again. Finally, you might get this error if you specify a port number that your operating system considers to be reserved. For example, many versions of Unix consider port numbers under 1024 to be \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003etrusted\u003c/span\u003e”\u003c/span\u003e and only permit the Unix superuser to access them.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.16.9\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eThe utility command \u003ca class=\"xref\" href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e can be used to start and shut down the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server safely and comfortably.\u003c/p\u003e\n\u003cp\u003eIf at all possible, \u003cspan class=\"emphasis\"\u003e\u003cem\u003edo not\u003c/em\u003e\u003c/span\u003e use \u003ccode class=\"literal\"\u003eSIGKILL\u003c/code\u003e to kill the main \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server. Doing so will prevent \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e from freeing the system resources (e.g., shared memory and semaphores) that it holds before terminating. This might cause problems for starting a fresh \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e run.\u003c/p\u003e\n\u003cp\u003eTo terminate the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server normally, the signals \u003ccode class=\"literal\"\u003eSIGTERM\u003c/code\u003e, \u003ccode class=\"literal\"\u003eSIGINT\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eSIGQUIT\u003c/code\u003e can be used. The first will wait for all clients to terminate before quitting, the second will forcefully disconnect all clients, and the third will quit immediately without proper shutdown, resulting in a recovery run during restart.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"literal\"\u003eSIGHUP\u003c/code\u003e signal will reload the server configuration files. It is also possible to send \u003ccode class=\"literal\"\u003eSIGHUP\u003c/code\u003e to an individual server process, but that is usually not sensible.\u003c/p\u003e\n\u003cp\u003eTo cancel a running query, send the \u003ccode class=\"literal\"\u003eSIGINT\u003c/code\u003e signal to the process running that command. To terminate a backend process cleanly, send \u003ccode class=\"literal\"\u003eSIGTERM\u003c/code\u003e to that process. See also \u003ccode class=\"function\"\u003epg_cancel_backend\u003c/code\u003e and \u003ccode class=\"function\"\u003epg_terminate_backend\u003c/code\u003e in \u003ca class=\"xref\" href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.28.2. Server Signaling Functions\"\u003eSection 9.28.2\u003c/a\u003e for the SQL-callable equivalents of these two actions.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server uses \u003ccode class=\"literal\"\u003eSIGQUIT\u003c/code\u003e to tell subordinate server processes to terminate without normal cleanup. This signal \u003cspan class=\"emphasis\"\u003e\u003cem\u003eshould not\u003c/em\u003e\u003c/span\u003e be used by users. It is also unwise to send \u003ccode class=\"literal\"\u003eSIGKILL\u003c/code\u003e to a server process — the main \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e process will interpret this as a crash and will force all the sibling processes to quit as part of its standard crash-recovery procedure.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-POSTGRES-BUGS\"\u003e\n\u003ch2\u003eBugs\u003c/h2\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003e--\u003c/code\u003e options will not work on \u003cspan class=\"systemitem\"\u003eFreeBSD\u003c/span\u003e or \u003cspan class=\"systemitem\"\u003eOpenBSD\u003c/span\u003e. Use \u003ccode class=\"option\"\u003e-c\u003c/code\u003e instead. This is a bug in the affected operating systems; a future release of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e will provide a workaround if this is not fixed.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\"\u003e\n\u003ch2\u003eSingle-User Mode\u003c/h2\u003e\n\u003cp\u003eTo start a single-user mode server, use a command like\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003epostgres --single -D /usr/local/pgsql/data \u003cem class=\"replaceable\"\u003e\u003ccode\u003eother-options\u003c/code\u003e\u003c/em\u003e my_database\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eProvide the correct path to the database directory with \u003ccode class=\"option\"\u003e-D\u003c/code\u003e, or make sure that the environment variable \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e is set. Also specify the name of the particular database you want to work in.\u003c/p\u003e\n\u003cp\u003eNormally, the single-user mode server treats newline as the command entry terminator; there is no intelligence about semicolons, as there is in \u003cspan class=\"application\"\u003epsql\u003c/span\u003e. To continue a command across multiple lines, you must type backslash just before each newline except the last one. The backslash and adjacent newline are both dropped from the input command. Note that this will happen even when within a string literal or comment.\u003c/p\u003e\n\u003cp\u003eBut if you use the \u003ccode class=\"option\"\u003e-j\u003c/code\u003e command line switch, a single newline does not terminate command entry; instead, the sequence semicolon-newline-newline does. That is, type a semicolon immediately followed by a completely empty line. Backslash-newline is not treated specially in this mode. Again, there is no intelligence about such a sequence appearing within a string literal or comment.\u003c/p\u003e\n\u003cp\u003eIn either input mode, if you type a semicolon that is not just before or part of a command entry terminator, it is considered a command separator. When you do type a command entry terminator, the multiple statements you've entered will be executed as a single transaction.\u003c/p\u003e\n\u003cp\u003eTo quit the session, type EOF (\u003cspan class=\"keycap\"\u003e\u003cstrong\u003eControl\u003c/strong\u003e\u003c/span\u003e+\u003cspan class=\"keycap\"\u003e\u003cstrong\u003eD\u003c/strong\u003e\u003c/span\u003e, usually). If you've entered any text since the last command entry terminator, then EOF will be taken as a command entry terminator, and another EOF will be needed to exit.\u003c/p\u003e\n\u003cp\u003eNote that the single-user mode server does not provide sophisticated line-editing features (no command history, for example). Single-user mode also does not do any background processing, such as automatic checkpoints or replication.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo start \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e in the background using default values, type:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003enohup postgres \u0026gt;logfile 2\u0026gt;\u0026amp;1 \u0026lt;/dev/null \u0026amp;\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo start \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e with a specific port, e.g., 1234:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epostgres -p 1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo connect to this server using \u003cspan class=\"application\"\u003epsql\u003c/span\u003e, specify this port with the -p option:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epsql -p 1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eor set the environment variable \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003eexport PGPORT=1234\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epsql\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eNamed run-time parameters can be set in either of these styles:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epostgres -c work_mem=1234\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epostgres --work-mem=1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eEither form overrides whatever setting might exist for \u003ccode class=\"varname\"\u003ework_mem\u003c/code\u003e in \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e. Notice that underscores in parameter names can be written as either underscore or dash on the command line. Except for short-term experiments, it's probably better practice to edit the setting in \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e than to rely on a command-line switch to set a parameter.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.16.13\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\n\u003cp\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-pg-ctl.html\" title=\"pg_ctl\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-postgres.html","options":[{"description":"Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter.","names":["-B nbuffers"],"signature":"-B nbuffers","source_url":"/docs/18/app-postgres.html","summary":"Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."},{"description":"Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters.","names":["-c name = value"],"signature":"-c name = value","source_url":"/docs/18/app-postgres.html","summary":"Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."},{"description":"Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started. This can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., shared_memory_size , shared_memory_size_in_huge_pages , and wal_segment_size ). This option is meant for other programs that interact with a server instance, such as pg_ctl , to query configuration parameter values. User-facing applications should instead use SHOW or the pg_settings view.","names":["-C name"],"signature":"-C name","source_url":"/docs/18/app-postgres.html","summary":"Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started."},{"description":"Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session.","names":["-d debug-level"],"signature":"-d debug-level","source_url":"/docs/18/app-postgres.html","summary":"Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."},{"description":"Specifies the file system location of the database configuration files. See Section 19.2 for details.","names":["-D datadir"],"signature":"-D datadir","source_url":"/docs/18/app-postgres.html","summary":"Specifies the file system location of the database configuration files. See Section 19.2 for details."},{"description":"Sets the default date style to “ European ” , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information.","names":["-e"],"signature":"-e","source_url":"/docs/18/app-postgres.html","summary":"Sets the default date style to “ European ” , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."},{"description":"Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!","names":["-F"],"signature":"-F","source_url":"/docs/18/app-postgres.html","summary":"Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"},{"description":"Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter.","names":["-h hostname"],"signature":"-h hostname","source_url":"/docs/18/app-postgres.html","summary":"Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."},{"description":"Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h . This option is deprecated since it does not allow access to the full functionality of listen_addresses . It's usually better to set listen_addresses directly.","names":["-i"],"signature":"-i","source_url":"/docs/18/app-postgres.html","summary":"Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h ."},{"description":"Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter.","names":["-k directory"],"signature":"-k directory","source_url":"/docs/18/app-postgres.html","summary":"Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."},{"description":"Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 .","names":["-l"],"signature":"-l","source_url":"/docs/18/app-postgres.html","summary":"Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."},{"description":"Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter.","names":["-N max-connections"],"signature":"-N max-connections","source_url":"/docs/18/app-postgres.html","summary":"Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."},{"description":"Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT .","names":["-p port"],"signature":"-p port","source_url":"/docs/18/app-postgres.html","summary":"Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."},{"description":"Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.","names":["-s"],"signature":"-s","source_url":"/docs/18/app-postgres.html","summary":"Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."},{"description":"Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 .","names":["-S"],"signature":"-S work-mem","source_url":"/docs/18/app-postgres.html","summary":"Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."},{"description":"Print the postgres version and exit.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/app-postgres.html","summary":"Print the postgres version and exit."},{"description":"Sets a named run-time parameter; a shorter form of -c .","names":["-- name = value"],"signature":"-- name = value","source_url":"/docs/18/app-postgres.html","summary":"Sets a named run-time parameter; a shorter form of -c ."},{"description":"This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools.","names":["--describe-config"],"signature":"--describe-config","source_url":"/docs/18/app-postgres.html","summary":"This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."},{"description":"Show help about postgres command line arguments, and exit.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-postgres.html","summary":"Show help about postgres command line arguments, and exit."},{"description":"Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively. Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative.","names":["-f"],"signature":"-f { s | i | o | b | t | n | m | h }","source_url":"/docs/18/app-postgres.html","summary":"Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively."},{"description":"Allows the structure of system tables to be modified. This is used by initdb .","names":["-O"],"signature":"-O","source_url":"/docs/18/app-postgres.html","summary":"Allows the structure of system tables to be modified. This is used by initdb ."},{"description":"Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.","names":["-P"],"signature":"-P","source_url":"/docs/18/app-postgres.html","summary":"Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."},{"description":"Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option.","names":["-t"],"signature":"-t pa[rser] | pl[anner] | e[xecutor]","source_url":"/docs/18/app-postgres.html","summary":"Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."},{"description":"This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files.","names":["-T"],"signature":"-T","source_url":"/docs/18/app-postgres.html","summary":"This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."},{"description":"Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.","names":["-v"],"signature":"-v protocol","source_url":"/docs/18/app-postgres.html","summary":"Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."},{"description":"A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.","names":["-W"],"signature":"-W seconds","source_url":"/docs/18/app-postgres.html","summary":"A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."},{"description":"Selects the single-user mode. This must be the first argument on the command line.","names":["--single"],"signature":"--single","source_url":"/docs/18/app-postgres.html","summary":"Selects the single-user mode. This must be the first argument on the command line."},{"description":"Echo all commands to standard output before executing them.","names":["-E"],"signature":"-E","source_url":"/docs/18/app-postgres.html","summary":"Echo all commands to standard output before executing them."},{"description":"Use semicolon followed by two newlines, rather than just newline, as the command entry terminator.","names":["-j"],"signature":"-j","source_url":"/docs/18/app-postgres.html","summary":"Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."},{"description":"Send all server log output to filename . This option is only honored when supplied as a command-line option.","names":["-r"],"signature":"-r filename","source_url":"/docs/18/app-postgres.html","summary":"Send all server log output to filename . This option is only honored when supplied as a command-line option."}],"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":[],"signature":"postgres [ option ...]","sources":[{"anchor":"","file":"app-postgres.html","label":"18.6 English manual · app-postgres.html","sha256":"7cc002e0a51fcdb1577e15fe6c728be6ed61dc0e6575c078234f0cbec1c7005d","url":"/docs/18/app-postgres.html"},{"anchor":"","file":"reference-server.html","label":"Server applications inventory","sha256":"e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3","url":"/docs/18/reference-server.html"}],"synopsis":["postgres [ option ...]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-B nbuffers","url":"/docs/18/app-postgres.html"},"summary":"Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."},{"signature":{"text":"-c name = value","url":"/docs/18/app-postgres.html"},"summary":"Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."},{"signature":{"text":"-C name","url":"/docs/18/app-postgres.html"},"summary":"Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started."},{"signature":{"text":"-d debug-level","url":"/docs/18/app-postgres.html"},"summary":"Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."},{"signature":{"text":"-D datadir","url":"/docs/18/app-postgres.html"},"summary":"Specifies the file system location of the database configuration files. See Section 19.2 for details."},{"signature":{"text":"-e","url":"/docs/18/app-postgres.html"},"summary":"Sets the default date style to “ European ” , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."},{"signature":{"text":"-F","url":"/docs/18/app-postgres.html"},"summary":"Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"},{"signature":{"text":"-h hostname","url":"/docs/18/app-postgres.html"},"summary":"Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."},{"signature":{"text":"-i","url":"/docs/18/app-postgres.html"},"summary":"Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h ."},{"signature":{"text":"-k directory","url":"/docs/18/app-postgres.html"},"summary":"Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."},{"signature":{"text":"-l","url":"/docs/18/app-postgres.html"},"summary":"Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."},{"signature":{"text":"-N max-connections","url":"/docs/18/app-postgres.html"},"summary":"Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."},{"signature":{"text":"-p port","url":"/docs/18/app-postgres.html"},"summary":"Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."},{"signature":{"text":"-s","url":"/docs/18/app-postgres.html"},"summary":"Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."},{"signature":{"text":"-S work-mem","url":"/docs/18/app-postgres.html"},"summary":"Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."},{"signature":{"text":"-V --version","url":"/docs/18/app-postgres.html"},"summary":"Print the postgres version and exit."},{"signature":{"text":"-- name = value","url":"/docs/18/app-postgres.html"},"summary":"Sets a named run-time parameter; a shorter form of -c ."},{"signature":{"text":"--describe-config","url":"/docs/18/app-postgres.html"},"summary":"This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."},{"signature":{"text":"-? --help","url":"/docs/18/app-postgres.html"},"summary":"Show help about postgres command line arguments, and exit."},{"signature":{"text":"-f { s | i | o | b | t | n | m | h }","url":"/docs/18/app-postgres.html"},"summary":"Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively."},{"signature":{"text":"-O","url":"/docs/18/app-postgres.html"},"summary":"Allows the structure of system tables to be modified. This is used by initdb ."},{"signature":{"text":"-P","url":"/docs/18/app-postgres.html"},"summary":"Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."},{"signature":{"text":"-t pa[rser] | pl[anner] | e[xecutor]","url":"/docs/18/app-postgres.html"},"summary":"Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."},{"signature":{"text":"-T","url":"/docs/18/app-postgres.html"},"summary":"This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."},{"signature":{"text":"-v protocol","url":"/docs/18/app-postgres.html"},"summary":"Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."},{"signature":{"text":"-W seconds","url":"/docs/18/app-postgres.html"},"summary":"A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."},{"signature":{"text":"--single","url":"/docs/18/app-postgres.html"},"summary":"Selects the single-user mode. This must be the first argument on the command line."},{"signature":{"text":"-E","url":"/docs/18/app-postgres.html"},"summary":"Echo all commands to standard output before executing them."},{"signature":{"text":"-j","url":"/docs/18/app-postgres.html"},"summary":"Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."},{"signature":{"text":"-r filename","url":"/docs/18/app-postgres.html"},"summary":"Send all server log output to filename . This option is only honored when supplied as a command-line option."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.","name":"PGCLIENTENCODING"},{"description":"Default data directory location","name":"PGDATA"},{"description":"Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)","name":"PGDATESTYLE"},{"description":"Default port number (preferably set in the configuration file)","name":"PGPORT"}],"title":"Environment variables"}]},"ManualEvidence":{"manual_path":"app-postgres.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-postgres.html","label":"18.6 English manual · app-postgres.html","sha256":"7cc002e0a51fcdb1577e15fe6c728be6ed61dc0e6575c078234f0cbec1c7005d","url":"/docs/18/app-postgres.html"},{"anchor":"","file":"reference-server.html","label":"Server applications inventory","sha256":"e9f8bbcc8e3641fadd1d20991e8aad6b532155b786ba5a1b7b364ec4f1a5bef3","url":"/docs/18/reference-server.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"postgres","SourceDatabase":"center","Version":"18","Locale":"en","Title":"postgres","Summary":"postgres — PostgreSQL database server","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-POSTGRES\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epostgres — \u003cspan\u003ePostgreSQL\u003c/span\u003e database 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.16.4.1\"\u003e\u003ccode\u003epostgres\u003c/code\u003e [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.16.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003epostgres\u003c/code\u003e is the \u003cspan\u003ePostgreSQL\u003c/span\u003e database server. In order for a client application to access a database it connects (over a network or locally) to a running \u003ccode\u003epostgres\u003c/code\u003e instance. The \u003ccode\u003epostgres\u003c/code\u003e instance then starts a separate server process to handle the connection.\u003c/p\u003e\n\u003cp\u003eOne \u003ccode\u003epostgres\u003c/code\u003e instance always manages the data of exactly one database cluster. A database cluster is a collection of databases that is stored at a common file system location (the \u003cspan\u003e“\u003cspan\u003edata area\u003c/span\u003e”\u003c/span\u003e). More than one \u003ccode\u003epostgres\u003c/code\u003e instance can run on a system at one time, so long as they use different data areas and different communication ports (see below). When \u003ccode\u003epostgres\u003c/code\u003e starts it needs to know the location of the data area. The location must be specified by the \u003ccode\u003e-D\u003c/code\u003e option or the \u003ccode\u003ePGDATA\u003c/code\u003e environment variable; there is no default. Typically, \u003ccode\u003e-D\u003c/code\u003e or \u003ccode\u003ePGDATA\u003c/code\u003e points directly to the data area directory created by \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. Other possible file layouts are discussed in \u003ca href=\"/docs/18/runtime-config-file-locations.html\" rel=\"nofollow\"\u003eSection 19.2\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eBy default \u003ccode\u003epostgres\u003c/code\u003e starts in the foreground and prints log messages to the standard error stream. In practical applications \u003ccode\u003epostgres\u003c/code\u003e should be started as a background process, perhaps at boot time.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode\u003epostgres\u003c/code\u003e command can also be called in single-user mode. The primary use for this mode is during bootstrapping by \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. Sometimes it is used for debugging or disaster recovery; note that running a single-user server is not truly suitable for debugging the server, since no realistic interprocess communication and locking will happen. When invoked in single-user mode from the shell, the user can enter queries and the results will be printed to the screen, but in a form that is more useful for developers than end users. In the single-user mode, the session user will be set to the user with ID 1, and implicit superuser powers are granted to this user. This user does not actually have to exist, so the single-user mode can be used to manually recover from certain kinds of accidental damage to the system catalogs.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-POSTGRES-OPTIONS\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003epostgres\u003c/code\u003e accepts the following command-line arguments. For a detailed discussion of the options consult \u003ca href=\"/docs/18/runtime-config.html\" rel=\"nofollow\"\u003eChapter 19\u003c/a\u003e. You can save typing most of these options by setting up a configuration file. Some (safe) options can also be set from the connecting client in an application-dependent way to apply only for that session. For example, if the environment variable \u003ccode\u003ePGOPTIONS\u003c/code\u003e is set, then \u003cspan\u003elibpq\u003c/span\u003e-based clients will pass that string to the server, which will interpret it as \u003ccode\u003epostgres\u003c/code\u003e command-line options.\u003c/p\u003e\n\u003cdiv id=\"id-1.9.5.16.6.3\"\u003e\n\u003ch3\u003eGeneral Purpose\u003c/h3\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-B \u003cem\u003e\u003ccode\u003enbuffers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by \u003cspan\u003einitdb\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\" rel=\"nofollow\"\u003eshared_buffers\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-c \u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e=\u003cem\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets a named run-time parameter. The configuration parameters supported by \u003cspan\u003ePostgreSQL\u003c/span\u003e are described in \u003ca href=\"/docs/18/runtime-config.html\" rel=\"nofollow\"\u003eChapter 19\u003c/a\u003e. Most of the other command line options are in fact short forms of such a parameter assignment. \u003ccode\u003e-c\u003c/code\u003e can appear multiple times to set multiple parameters.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-C \u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrints the value of the named run-time parameter, and exits. (See the \u003ccode\u003e-c\u003c/code\u003e option above for details.) This returns values from \u003ccode\u003epostgresql.conf\u003c/code\u003e, modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.\u003c/p\u003e\n\u003cp\u003eThis can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., \u003ca href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\" rel=\"nofollow\"\u003eshared_memory_size\u003c/a\u003e, \u003ca href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\" rel=\"nofollow\"\u003eshared_memory_size_in_huge_pages\u003c/a\u003e, and \u003ca href=\"/docs/18/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\" rel=\"nofollow\"\u003ewal_segment_size\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eThis option is meant for other programs that interact with a server instance, such as \u003ca href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, to query configuration parameter values. User-facing applications should instead use \u003ca href=\"/docs/18/sql-show.html\" title=\"SHOW\" rel=\"nofollow\"\u003e\u003ccode\u003eSHOW\u003c/code\u003e\u003c/a\u003e or the \u003ccode\u003epg_settings\u003c/code\u003e view.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-d \u003cem\u003e\u003ccode\u003edebug-level\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass \u003ccode\u003e-d 0\u003c/code\u003e for a specific session, which will prevent the server log level of the parent \u003ccode\u003epostgres\u003c/code\u003e process from being propagated to this session.\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\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file system location of the database configuration files. See \u003ca href=\"/docs/18/runtime-config-file-locations.html\" rel=\"nofollow\"\u003eSection 19.2\u003c/a\u003e for details.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the default date style to \u003cspan\u003e“\u003cspan\u003eEuropean\u003c/span\u003e”\u003c/span\u003e, that is \u003ccode\u003eDMY\u003c/code\u003e ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See \u003ca href=\"/docs/18/datatype-datetime.html\" rel=\"nofollow\"\u003eSection 8.5\u003c/a\u003e for more information.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-F\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables \u003ccode\u003efsync\u003c/code\u003e calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the \u003ca href=\"/docs/18/runtime-config-wal.html#GUC-FSYNC\" rel=\"nofollow\"\u003efsync\u003c/a\u003e configuration parameter. Read the detailed documentation before using this!\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-h \u003cem\u003e\u003ccode\u003ehostname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the IP host name or address on which \u003ccode\u003epostgres\u003c/code\u003e is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or \u003ccode\u003e*\u003c/code\u003e to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on \u003cspan\u003elocalhost\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\" rel=\"nofollow\"\u003elisten_addresses\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-i\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting \u003ccode\u003elisten_addresses\u003c/code\u003e to \u003ccode\u003e*\u003c/code\u003e in \u003ccode\u003epostgresql.conf\u003c/code\u003e or via \u003ccode\u003e-h\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option is deprecated since it does not allow access to the full functionality of \u003ca href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\" rel=\"nofollow\"\u003elisten_addresses\u003c/a\u003e. It\u0026#39;s usually better to set \u003ccode\u003elisten_addresses\u003c/code\u003e directly.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-k \u003cem\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory of the Unix-domain socket on which \u003ccode\u003epostgres\u003c/code\u003e is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally \u003ccode\u003e/tmp\u003c/code\u003e, but that can be changed at build time. Specifying this option is equivalent to setting the \u003ca href=\"/docs/18/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\" rel=\"nofollow\"\u003eunix_socket_directories\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-l\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnables secure connections using SSL. \u003cspan\u003ePostgreSQL\u003c/span\u003e must have been compiled with support for SSL for this option to be available. For more information on using SSL, refer to \u003ca href=\"/docs/18/ssl-tcp.html\" rel=\"nofollow\"\u003eSection 18.9\u003c/a\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-N \u003cem\u003e\u003ccode\u003emax-connections\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by \u003cspan\u003einitdb\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\" rel=\"nofollow\"\u003emax_connections\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-p \u003cem\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP/IP port or local Unix domain socket file extension on which \u003ccode\u003epostgres\u003c/code\u003e is to listen for connections from client applications. Defaults to the value of the \u003ccode\u003ePGPORT\u003c/code\u003e environment variable, or if \u003ccode\u003ePGPORT\u003c/code\u003e is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or \u003ccode\u003ePGPORT\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-s\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-S\u003c/code\u003e \u003cem\u003e\u003ccode\u003ework-mem\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the \u003ccode\u003ework_mem\u003c/code\u003e configuration parameter in \u003ca href=\"/docs/18/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" rel=\"nofollow\"\u003eSection 19.4.1\u003c/a\u003e.\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\u003epostgres\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--\u003cem\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e=\u003cem\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets a named run-time parameter; a shorter form of \u003ccode\u003e-c\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--describe-config\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option dumps out the server\u0026#39;s internal configuration variables, descriptions, and defaults in tab-delimited \u003ccode\u003eCOPY\u003c/code\u003e format. It is designed primarily for use by administration tools.\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\u003epostgres\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.16.6.4\"\u003e\n\u003ch3\u003eSemi-Internal Options\u003c/h3\u003e\n\u003cp\u003eThe options described here are used mainly for debugging purposes, and in some cases to assist with recovery of severely damaged databases. There should be no reason to use them in a production database setup. They are listed here only for use by \u003cspan\u003ePostgreSQL\u003c/span\u003e system developers. Furthermore, these options might change or be removed in a future release without notice.\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-f\u003c/code\u003e \u003ccode\u003e{ s | i | o | b | t | n | m | h }\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForbids the use of particular scan and join methods: \u003ccode\u003es\u003c/code\u003e and \u003ccode\u003ei\u003c/code\u003e disable sequential and index scans respectively, \u003ccode\u003eo\u003c/code\u003e, \u003ccode\u003eb\u003c/code\u003e and \u003ccode\u003et\u003c/code\u003e disable index-only scans, bitmap index scans, and TID scans respectively, while \u003ccode\u003en\u003c/code\u003e, \u003ccode\u003em\u003c/code\u003e, and \u003ccode\u003eh\u003c/code\u003e disable nested-loop, merge and hash joins respectively.\u003c/p\u003e\n\u003cp\u003eNeither sequential scans nor nested-loop joins can be disabled completely; the \u003ccode\u003e-fs\u003c/code\u003e and \u003ccode\u003e-fn\u003c/code\u003e options simply discourage the optimizer from using those plan types if it has any other alternative.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-O\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows the structure of system tables to be modified. This is used by \u003ccode\u003einitdb\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-P\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIgnore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-t\u003c/code\u003e \u003ccode\u003epa[rser] | pl[anner] | e[xecutor]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint timing statistics for each query relating to each of the major system modules. This option cannot be used together with the \u003ccode\u003e-s\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-T\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them \u003cspan\u003eSIGQUIT\u003c/span\u003e signals. With this option, \u003cspan\u003eSIGABRT\u003c/span\u003e will be sent instead, resulting in production of core dump files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-v\u003c/code\u003e \u003cem\u003e\u003ccode\u003eprotocol\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-W\u003c/code\u003e \u003cem\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eA delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.16.6.5\"\u003e\n\u003ch3\u003eOptions for Single-User Mode\u003c/h3\u003e\n\u003cp\u003eThe following options only apply to the single-user mode (see \u003ca href=\"/docs/18/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"Single-User Mode\" rel=\"nofollow\"\u003eSingle-User Mode\u003c/a\u003e below).\u003c/p\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--single\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSelects the single-user mode. This must be the first argument on the command line.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003cem\u003e\u003ccode\u003edatabase\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to be accessed. This must be the last argument on the command line. If it is omitted it defaults to the user name.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-E\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho all commands to standard output before executing them.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-j\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse semicolon followed by two newlines, rather than just newline, as the command entry terminator.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-r\u003c/code\u003e \u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSend all server log output to \u003cem\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. This option is only honored when supplied as a command-line option.\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.16.7\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGCLIENTENCODING\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.\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\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGDATESTYLE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault value of the \u003ca href=\"/docs/18/runtime-config-client.html#GUC-DATESTYLE\" rel=\"nofollow\"\u003eDateStyle\u003c/a\u003e run-time parameter. (The use of this environment variable is deprecated.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003ePGPORT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault port number (preferably set in the configuration file)\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.16.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eA failure message mentioning \u003ccode\u003esemget\u003c/code\u003e or \u003ccode\u003eshmget\u003c/code\u003e probably indicates you need to configure your kernel to provide adequate shared memory and semaphores. For more discussion see \u003ca href=\"/docs/18/kernel-resources.html\" rel=\"nofollow\"\u003eSection 18.4\u003c/a\u003e. You might be able to postpone reconfiguring your kernel by decreasing \u003ca href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\" rel=\"nofollow\"\u003eshared_buffers\u003c/a\u003e to reduce the shared memory consumption of \u003cspan\u003ePostgreSQL\u003c/span\u003e, and/or by reducing \u003ca href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\" rel=\"nofollow\"\u003emax_connections\u003c/a\u003e to reduce the semaphore consumption.\u003c/p\u003e\n\u003cp\u003eA failure message suggesting that another server is already running should be checked carefully, for example by using the command\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003eps ax | grep postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eor\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003eps -ef | grep postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003edepending on your system. If you are certain that no conflicting server is running, you can remove the lock file mentioned in the message and try again.\u003c/p\u003e\n\u003cp\u003eA failure message indicating inability to bind to a port might indicate that that port is already in use by some non-\u003cspan\u003ePostgreSQL\u003c/span\u003e process. You might also get this error if you terminate \u003ccode\u003epostgres\u003c/code\u003e and immediately restart it using the same port; in this case, you must simply wait a few seconds until the operating system closes the port before trying again. Finally, you might get this error if you specify a port number that your operating system considers to be reserved. For example, many versions of Unix consider port numbers under 1024 to be \u003cspan\u003e“\u003cspan\u003etrusted\u003c/span\u003e”\u003c/span\u003e and only permit the Unix superuser to access them.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.16.9\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eThe utility command \u003ca href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e can be used to start and shut down the \u003ccode\u003epostgres\u003c/code\u003e server safely and comfortably.\u003c/p\u003e\n\u003cp\u003eIf at all possible, \u003cspan\u003e\u003cem\u003edo not\u003c/em\u003e\u003c/span\u003e use \u003ccode\u003eSIGKILL\u003c/code\u003e to kill the main \u003ccode\u003epostgres\u003c/code\u003e server. Doing so will prevent \u003ccode\u003epostgres\u003c/code\u003e from freeing the system resources (e.g., shared memory and semaphores) that it holds before terminating. This might cause problems for starting a fresh \u003ccode\u003epostgres\u003c/code\u003e run.\u003c/p\u003e\n\u003cp\u003eTo terminate the \u003ccode\u003epostgres\u003c/code\u003e server normally, the signals \u003ccode\u003eSIGTERM\u003c/code\u003e, \u003ccode\u003eSIGINT\u003c/code\u003e, or \u003ccode\u003eSIGQUIT\u003c/code\u003e can be used. The first will wait for all clients to terminate before quitting, the second will forcefully disconnect all clients, and the third will quit immediately without proper shutdown, resulting in a recovery run during restart.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode\u003eSIGHUP\u003c/code\u003e signal will reload the server configuration files. It is also possible to send \u003ccode\u003eSIGHUP\u003c/code\u003e to an individual server process, but that is usually not sensible.\u003c/p\u003e\n\u003cp\u003eTo cancel a running query, send the \u003ccode\u003eSIGINT\u003c/code\u003e signal to the process running that command. To terminate a backend process cleanly, send \u003ccode\u003eSIGTERM\u003c/code\u003e to that process. See also \u003ccode\u003epg_cancel_backend\u003c/code\u003e and \u003ccode\u003epg_terminate_backend\u003c/code\u003e in \u003ca href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" rel=\"nofollow\"\u003eSection 9.28.2\u003c/a\u003e for the SQL-callable equivalents of these two actions.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode\u003epostgres\u003c/code\u003e server uses \u003ccode\u003eSIGQUIT\u003c/code\u003e to tell subordinate server processes to terminate without normal cleanup. This signal \u003cspan\u003e\u003cem\u003eshould not\u003c/em\u003e\u003c/span\u003e be used by users. It is also unwise to send \u003ccode\u003eSIGKILL\u003c/code\u003e to a server process — the main \u003ccode\u003epostgres\u003c/code\u003e process will interpret this as a crash and will force all the sibling processes to quit as part of its standard crash-recovery procedure.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-POSTGRES-BUGS\"\u003e\n\u003ch2\u003eBugs\u003c/h2\u003e\n\u003cp\u003eThe \u003ccode\u003e--\u003c/code\u003e options will not work on \u003cspan\u003eFreeBSD\u003c/span\u003e or \u003cspan\u003eOpenBSD\u003c/span\u003e. Use \u003ccode\u003e-c\u003c/code\u003e instead. This is a bug in the affected operating systems; a future release of \u003cspan\u003ePostgreSQL\u003c/span\u003e will provide a workaround if this is not fixed.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-POSTGRES-SINGLE-USER\"\u003e\n\u003ch2\u003eSingle-User Mode\u003c/h2\u003e\n\u003cp\u003eTo start a single-user mode server, use a command like\u003c/p\u003e\n\u003cpre\u003e\u003cstrong\u003e\u003ccode\u003epostgres --single -D /usr/local/pgsql/data \u003cem\u003e\u003ccode\u003eother-options\u003c/code\u003e\u003c/em\u003e my_database\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eProvide the correct path to the database directory with \u003ccode\u003e-D\u003c/code\u003e, or make sure that the environment variable \u003ccode\u003ePGDATA\u003c/code\u003e is set. Also specify the name of the particular database you want to work in.\u003c/p\u003e\n\u003cp\u003eNormally, the single-user mode server treats newline as the command entry terminator; there is no intelligence about semicolons, as there is in \u003cspan\u003epsql\u003c/span\u003e. To continue a command across multiple lines, you must type backslash just before each newline except the last one. The backslash and adjacent newline are both dropped from the input command. Note that this will happen even when within a string literal or comment.\u003c/p\u003e\n\u003cp\u003eBut if you use the \u003ccode\u003e-j\u003c/code\u003e command line switch, a single newline does not terminate command entry; instead, the sequence semicolon-newline-newline does. That is, type a semicolon immediately followed by a completely empty line. Backslash-newline is not treated specially in this mode. Again, there is no intelligence about such a sequence appearing within a string literal or comment.\u003c/p\u003e\n\u003cp\u003eIn either input mode, if you type a semicolon that is not just before or part of a command entry terminator, it is considered a command separator. When you do type a command entry terminator, the multiple statements you\u0026#39;ve entered will be executed as a single transaction.\u003c/p\u003e\n\u003cp\u003eTo quit the session, type EOF (\u003cspan\u003e\u003cstrong\u003eControl\u003c/strong\u003e\u003c/span\u003e+\u003cspan\u003e\u003cstrong\u003eD\u003c/strong\u003e\u003c/span\u003e, usually). If you\u0026#39;ve entered any text since the last command entry terminator, then EOF will be taken as a command entry terminator, and another EOF will be needed to exit.\u003c/p\u003e\n\u003cp\u003eNote that the single-user mode server does not provide sophisticated line-editing features (no command history, for example). Single-user mode also does not do any background processing, such as automatic checkpoints or replication.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-POSTGRES-EXAMPLES\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo start \u003ccode\u003epostgres\u003c/code\u003e in the background using default values, type:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003enohup postgres \u0026gt;logfile 2\u0026gt;\u0026amp;1 \u0026lt;/dev/null \u0026amp;\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo start \u003ccode\u003epostgres\u003c/code\u003e with a specific port, e.g., 1234:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epostgres -p 1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo connect to this server using \u003cspan\u003epsql\u003c/span\u003e, specify this port with the -p option:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epsql -p 1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eor set the environment variable \u003ccode\u003ePGPORT\u003c/code\u003e:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003eexport PGPORT=1234\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epsql\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eNamed run-time parameters can be set in either of these styles:\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epostgres -c work_mem=1234\u003c/code\u003e\u003c/strong\u003e\n\u003ccode\u003e$\u003c/code\u003e \u003cstrong\u003e\u003ccode\u003epostgres --work-mem=1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eEither form overrides whatever setting might exist for \u003ccode\u003ework_mem\u003c/code\u003e in \u003ccode\u003epostgresql.conf\u003c/code\u003e. Notice that underscores in parameter names can be written as either underscore or dash on the command line. Except for short-term experiments, it\u0026#39;s probably better practice to edit the setting in \u003ccode\u003epostgresql.conf\u003c/code\u003e than to rely on a command-line switch to set a parameter.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.5.16.13\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\n\u003cp\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-pg-ctl.html\" title=\"pg_ctl\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"eafa5d2ea881102df14b10a8646677800fc490e53abe90af3c9e7a7bc88d6f2d","Payload":{"description":["postgres — PostgreSQL database server"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-POSTGRES\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epostgres\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epostgres — \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database 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.16.4.1\"\u003e\u003ccode class=\"command\"\u003epostgres\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.16.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003epostgres\u003c/code\u003e is the \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e database server. In order for a client application to access a database it connects (over a network or locally) to a running \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e instance. The \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e instance then starts a separate server process to handle the connection.\u003c/p\u003e\n\u003cp\u003eOne \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e instance always manages the data of exactly one database cluster. A database cluster is a collection of databases that is stored at a common file system location (the \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003edata area\u003c/span\u003e”\u003c/span\u003e). More than one \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e instance can run on a system at one time, so long as they use different data areas and different communication ports (see below). When \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e starts it needs to know the location of the data area. The location must be specified by the \u003ccode class=\"option\"\u003e-D\u003c/code\u003e option or the \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e environment variable; there is no default. Typically, \u003ccode class=\"option\"\u003e-D\u003c/code\u003e or \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e points directly to the data area directory created by \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. Other possible file layouts are discussed in \u003ca class=\"xref\" href=\"/docs/18/runtime-config-file-locations.html\" title=\"19.2. File Locations\"\u003eSection 19.2\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eBy default \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e starts in the foreground and prints log messages to the standard error stream. In practical applications \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e should be started as a background process, perhaps at boot time.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e command can also be called in single-user mode. The primary use for this mode is during bootstrapping by \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. Sometimes it is used for debugging or disaster recovery; note that running a single-user server is not truly suitable for debugging the server, since no realistic interprocess communication and locking will happen. When invoked in single-user mode from the shell, the user can enter queries and the results will be printed to the screen, but in a form that is more useful for developers than end users. In the single-user mode, the session user will be set to the user with ID 1, and implicit superuser powers are granted to this user. This user does not actually have to exist, so the single-user mode can be used to manually recover from certain kinds of accidental damage to the system catalogs.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-POSTGRES-OPTIONS\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"command\"\u003epostgres\u003c/code\u003e accepts the following command-line arguments. For a detailed discussion of the options consult \u003ca class=\"xref\" href=\"/docs/18/runtime-config.html\" title=\"Chapter 19. Server Configuration\"\u003eChapter 19\u003c/a\u003e. You can save typing most of these options by setting up a configuration file. Some (safe) options can also be set from the connecting client in an application-dependent way to apply only for that session. For example, if the environment variable \u003ccode class=\"envar\"\u003ePGOPTIONS\u003c/code\u003e is set, then \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e-based clients will pass that string to the server, which will interpret it as \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e command-line options.\u003c/p\u003e\n\u003cdiv class=\"refsect2\" id=\"id-1.9.5.16.6.3\"\u003e\n\u003ch3\u003eGeneral Purpose\u003c/h3\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-B \u003cem class=\"replaceable\"\u003e\u003ccode\u003enbuffers\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by \u003cspan class=\"application\"\u003einitdb\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\"\u003eshared_buffers\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-c \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e=\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets a named run-time parameter. The configuration parameters supported by \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e are described in \u003ca class=\"xref\" href=\"/docs/18/runtime-config.html\" title=\"Chapter 19. Server Configuration\"\u003eChapter 19\u003c/a\u003e. Most of the other command line options are in fact short forms of such a parameter assignment. \u003ccode class=\"option\"\u003e-c\u003c/code\u003e can appear multiple times to set multiple parameters.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-C \u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrints the value of the named run-time parameter, and exits. (See the \u003ccode class=\"option\"\u003e-c\u003c/code\u003e option above for details.) This returns values from \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e, modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started.\u003c/p\u003e\n\u003cp\u003eThis can be used on a running server for most parameters. However, the server must be shut down for some runtime-computed parameters (e.g., \u003ca class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE\"\u003eshared_memory_size\u003c/a\u003e, \u003ca class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES\"\u003eshared_memory_size_in_huge_pages\u003c/a\u003e, and \u003ca class=\"xref\" href=\"/docs/18/runtime-config-preset.html#GUC-WAL-SEGMENT-SIZE\"\u003ewal_segment_size\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eThis option is meant for other programs that interact with a server instance, such as \u003ca class=\"xref\" href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, to query configuration parameter values. User-facing applications should instead use \u003ca class=\"link\" href=\"/docs/18/sql-show.html\" title=\"SHOW\"\u003e\u003ccode class=\"command\"\u003eSHOW\u003c/code\u003e\u003c/a\u003e or the \u003ccode class=\"structname\"\u003epg_settings\u003c/code\u003e view.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d \u003cem class=\"replaceable\"\u003e\u003ccode\u003edebug-level\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass \u003ccode class=\"literal\"\u003e-d 0\u003c/code\u003e for a specific session, which will prevent the server log level of the parent \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e process from being propagated to this session.\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\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the file system location of the database configuration files. See \u003ca class=\"xref\" href=\"/docs/18/runtime-config-file-locations.html\" title=\"19.2. File Locations\"\u003eSection 19.2\u003c/a\u003e for details.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the default date style to \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003eEuropean\u003c/span\u003e”\u003c/span\u003e, that is \u003ccode class=\"literal\"\u003eDMY\u003c/code\u003e ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See \u003ca class=\"xref\" href=\"/docs/18/datatype-datetime.html\" title=\"8.5. Date/Time Types\"\u003eSection 8.5\u003c/a\u003e for more information.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-F\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables \u003ccode class=\"function\"\u003efsync\u003c/code\u003e calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-wal.html#GUC-FSYNC\"\u003efsync\u003c/a\u003e configuration parameter. Read the detailed documentation before using this!\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-h \u003cem class=\"replaceable\"\u003e\u003ccode\u003ehostname\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the IP host name or address on which \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or \u003ccode class=\"literal\"\u003e*\u003c/code\u003e to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on \u003cspan class=\"systemitem\"\u003elocalhost\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\"\u003elisten_addresses\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-i\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting \u003ccode class=\"varname\"\u003elisten_addresses\u003c/code\u003e to \u003ccode class=\"literal\"\u003e*\u003c/code\u003e in \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e or via \u003ccode class=\"option\"\u003e-h\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option is deprecated since it does not allow access to the full functionality of \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-LISTEN-ADDRESSES\"\u003elisten_addresses\u003c/a\u003e. It's usually better to set \u003ccode class=\"varname\"\u003elisten_addresses\u003c/code\u003e directly.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-k \u003cem class=\"replaceable\"\u003e\u003ccode\u003edirectory\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the directory of the Unix-domain socket on which \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally \u003ccode class=\"filename\"\u003e/tmp\u003c/code\u003e, but that can be changed at build time. Specifying this option is equivalent to setting the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-UNIX-SOCKET-DIRECTORIES\"\u003eunix_socket_directories\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-l\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEnables secure connections using SSL. \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e must have been compiled with support for SSL for this option to be available. For more information on using SSL, refer to \u003ca class=\"xref\" href=\"/docs/18/ssl-tcp.html\" title=\"18.9. Secure TCP/IP Connections with SSL\"\u003eSection 18.9\u003c/a\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\u003emax-connections\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by \u003cspan class=\"application\"\u003einitdb\u003c/span\u003e. Specifying this option is equivalent to setting the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e configuration parameter.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-p \u003cem class=\"replaceable\"\u003e\u003ccode\u003eport\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the TCP/IP port or local Unix domain socket file extension on which \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e is to listen for connections from client applications. Defaults to the value of the \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e environment variable, or if \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-s\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-S\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003ework-mem\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the \u003ccode class=\"varname\"\u003ework_mem\u003c/code\u003e configuration parameter in \u003ca class=\"xref\" href=\"/docs/18/runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY\" title=\"19.4.1. Memory\"\u003eSection 19.4.1\u003c/a\u003e.\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\"\u003epostgres\u003c/span\u003e version and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--\u003cem class=\"replaceable\"\u003e\u003ccode\u003ename\u003c/code\u003e\u003c/em\u003e=\u003cem class=\"replaceable\"\u003e\u003ccode\u003evalue\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSets a named run-time parameter; a shorter form of \u003ccode class=\"option\"\u003e-c\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--describe-config\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited \u003ccode class=\"command\"\u003eCOPY\u003c/code\u003e format. It is designed primarily for use by administration tools.\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\"\u003epostgres\u003c/span\u003e command line arguments, and exit.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"id-1.9.5.16.6.4\"\u003e\n\u003ch3\u003eSemi-Internal Options\u003c/h3\u003e\n\u003cp\u003eThe options described here are used mainly for debugging purposes, and in some cases to assist with recovery of severely damaged databases. There should be no reason to use them in a production database setup. They are listed here only for use by \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e system developers. Furthermore, these options might change or be removed in a future release without notice.\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-f\u003c/code\u003e \u003ccode class=\"literal\"\u003e{ s | i | o | b | t | n | m | h }\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eForbids the use of particular scan and join methods: \u003ccode class=\"literal\"\u003es\u003c/code\u003e and \u003ccode class=\"literal\"\u003ei\u003c/code\u003e disable sequential and index scans respectively, \u003ccode class=\"literal\"\u003eo\u003c/code\u003e, \u003ccode class=\"literal\"\u003eb\u003c/code\u003e and \u003ccode class=\"literal\"\u003et\u003c/code\u003e disable index-only scans, bitmap index scans, and TID scans respectively, while \u003ccode class=\"literal\"\u003en\u003c/code\u003e, \u003ccode class=\"literal\"\u003em\u003c/code\u003e, and \u003ccode class=\"literal\"\u003eh\u003c/code\u003e disable nested-loop, merge and hash joins respectively.\u003c/p\u003e\n\u003cp\u003eNeither sequential scans nor nested-loop joins can be disabled completely; the \u003ccode class=\"literal\"\u003e-fs\u003c/code\u003e and \u003ccode class=\"literal\"\u003e-fn\u003c/code\u003e options simply discourage the optimizer from using those plan types if it has any other alternative.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-O\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eAllows the structure of system tables to be modified. This is used by \u003ccode class=\"command\"\u003einitdb\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-P\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eIgnore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-t\u003c/code\u003e \u003ccode class=\"literal\"\u003epa[rser] | pl[anner] | e[xecutor]\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint timing statistics for each query relating to each of the major system modules. This option cannot be used together with the \u003ccode class=\"option\"\u003e-s\u003c/code\u003e option.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-T\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThis option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them \u003cspan class=\"systemitem\"\u003eSIGQUIT\u003c/span\u003e signals. With this option, \u003cspan class=\"systemitem\"\u003eSIGABRT\u003c/span\u003e will be sent instead, resulting in production of core dump files.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-v\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eprotocol\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-W\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003eseconds\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eA delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect2\" id=\"id-1.9.5.16.6.5\"\u003e\n\u003ch3\u003eOptions for Single-User Mode\u003c/h3\u003e\n\u003cp\u003eThe following options only apply to the single-user mode (see \u003ca class=\"xref\" href=\"/docs/18/app-postgres.html#APP-POSTGRES-SINGLE-USER\" title=\"Single-User Mode\"\u003eSingle-User Mode\u003c/a\u003e below).\u003c/p\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--single\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSelects the single-user mode. This must be the first argument on the command line.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003cem class=\"replaceable\"\u003e\u003ccode\u003edatabase\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the name of the database to be accessed. This must be the last argument on the command line. If it is omitted it defaults to the user name.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-E\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eEcho all commands to standard output before executing them.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-j\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse semicolon followed by two newlines, rather than just newline, as the command entry terminator.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-r\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSend all server log output to \u003cem class=\"replaceable\"\u003e\u003ccode\u003efilename\u003c/code\u003e\u003c/em\u003e. This option is only honored when supplied as a command-line option.\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.16.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\"\u003ePGCLIENTENCODING\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.\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\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGDATESTYLE\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault value of the \u003ca class=\"xref\" href=\"/docs/18/runtime-config-client.html#GUC-DATESTYLE\"\u003eDateStyle\u003c/a\u003e run-time parameter. (The use of this environment variable is deprecated.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDefault port number (preferably set in the configuration file)\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.16.8\"\u003e\n\u003ch2\u003eDiagnostics\u003c/h2\u003e\n\u003cp\u003eA failure message mentioning \u003ccode class=\"literal\"\u003esemget\u003c/code\u003e or \u003ccode class=\"literal\"\u003eshmget\u003c/code\u003e probably indicates you need to configure your kernel to provide adequate shared memory and semaphores. For more discussion see \u003ca class=\"xref\" href=\"/docs/18/kernel-resources.html\" title=\"18.4. Managing Kernel Resources\"\u003eSection 18.4\u003c/a\u003e. You might be able to postpone reconfiguring your kernel by decreasing \u003ca class=\"xref\" href=\"/docs/18/runtime-config-resource.html#GUC-SHARED-BUFFERS\"\u003eshared_buffers\u003c/a\u003e to reduce the shared memory consumption of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e, and/or by reducing \u003ca class=\"xref\" href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e to reduce the semaphore consumption.\u003c/p\u003e\n\u003cp\u003eA failure message suggesting that another server is already running should be checked carefully, for example by using the command\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003eps ax | grep postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eor\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003eps -ef | grep postgres\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003edepending on your system. If you are certain that no conflicting server is running, you can remove the lock file mentioned in the message and try again.\u003c/p\u003e\n\u003cp\u003eA failure message indicating inability to bind to a port might indicate that that port is already in use by some non-\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e process. You might also get this error if you terminate \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e and immediately restart it using the same port; in this case, you must simply wait a few seconds until the operating system closes the port before trying again. Finally, you might get this error if you specify a port number that your operating system considers to be reserved. For example, many versions of Unix consider port numbers under 1024 to be \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003etrusted\u003c/span\u003e”\u003c/span\u003e and only permit the Unix superuser to access them.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.16.9\"\u003e\n\u003ch2\u003eNotes\u003c/h2\u003e\n\u003cp\u003eThe utility command \u003ca class=\"xref\" href=\"/docs/18/app-pg-ctl.html\" title=\"pg_ctl\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e can be used to start and shut down the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server safely and comfortably.\u003c/p\u003e\n\u003cp\u003eIf at all possible, \u003cspan class=\"emphasis\"\u003e\u003cem\u003edo not\u003c/em\u003e\u003c/span\u003e use \u003ccode class=\"literal\"\u003eSIGKILL\u003c/code\u003e to kill the main \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server. Doing so will prevent \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e from freeing the system resources (e.g., shared memory and semaphores) that it holds before terminating. This might cause problems for starting a fresh \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e run.\u003c/p\u003e\n\u003cp\u003eTo terminate the \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server normally, the signals \u003ccode class=\"literal\"\u003eSIGTERM\u003c/code\u003e, \u003ccode class=\"literal\"\u003eSIGINT\u003c/code\u003e, or \u003ccode class=\"literal\"\u003eSIGQUIT\u003c/code\u003e can be used. The first will wait for all clients to terminate before quitting, the second will forcefully disconnect all clients, and the third will quit immediately without proper shutdown, resulting in a recovery run during restart.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"literal\"\u003eSIGHUP\u003c/code\u003e signal will reload the server configuration files. It is also possible to send \u003ccode class=\"literal\"\u003eSIGHUP\u003c/code\u003e to an individual server process, but that is usually not sensible.\u003c/p\u003e\n\u003cp\u003eTo cancel a running query, send the \u003ccode class=\"literal\"\u003eSIGINT\u003c/code\u003e signal to the process running that command. To terminate a backend process cleanly, send \u003ccode class=\"literal\"\u003eSIGTERM\u003c/code\u003e to that process. See also \u003ccode class=\"function\"\u003epg_cancel_backend\u003c/code\u003e and \u003ccode class=\"function\"\u003epg_terminate_backend\u003c/code\u003e in \u003ca class=\"xref\" href=\"/docs/18/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL\" title=\"9.28.2. Server Signaling Functions\"\u003eSection 9.28.2\u003c/a\u003e for the SQL-callable equivalents of these two actions.\u003c/p\u003e\n\u003cp\u003eThe \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e server uses \u003ccode class=\"literal\"\u003eSIGQUIT\u003c/code\u003e to tell subordinate server processes to terminate without normal cleanup. This signal \u003cspan class=\"emphasis\"\u003e\u003cem\u003eshould not\u003c/em\u003e\u003c/span\u003e be used by users. It is also unwise to send \u003ccode class=\"literal\"\u003eSIGKILL\u003c/code\u003e to a server process — the main \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e process will interpret this as a crash and will force all the sibling processes to quit as part of its standard crash-recovery procedure.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-POSTGRES-BUGS\"\u003e\n\u003ch2\u003eBugs\u003c/h2\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003e--\u003c/code\u003e options will not work on \u003cspan class=\"systemitem\"\u003eFreeBSD\u003c/span\u003e or \u003cspan class=\"systemitem\"\u003eOpenBSD\u003c/span\u003e. Use \u003ccode class=\"option\"\u003e-c\u003c/code\u003e instead. This is a bug in the affected operating systems; a future release of \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e will provide a workaround if this is not fixed.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-POSTGRES-SINGLE-USER\"\u003e\n\u003ch2\u003eSingle-User Mode\u003c/h2\u003e\n\u003cp\u003eTo start a single-user mode server, use a command like\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003cstrong class=\"userinput\"\u003e\u003ccode\u003epostgres --single -D /usr/local/pgsql/data \u003cem class=\"replaceable\"\u003e\u003ccode\u003eother-options\u003c/code\u003e\u003c/em\u003e my_database\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eProvide the correct path to the database directory with \u003ccode class=\"option\"\u003e-D\u003c/code\u003e, or make sure that the environment variable \u003ccode class=\"envar\"\u003ePGDATA\u003c/code\u003e is set. Also specify the name of the particular database you want to work in.\u003c/p\u003e\n\u003cp\u003eNormally, the single-user mode server treats newline as the command entry terminator; there is no intelligence about semicolons, as there is in \u003cspan class=\"application\"\u003epsql\u003c/span\u003e. To continue a command across multiple lines, you must type backslash just before each newline except the last one. The backslash and adjacent newline are both dropped from the input command. Note that this will happen even when within a string literal or comment.\u003c/p\u003e\n\u003cp\u003eBut if you use the \u003ccode class=\"option\"\u003e-j\u003c/code\u003e command line switch, a single newline does not terminate command entry; instead, the sequence semicolon-newline-newline does. That is, type a semicolon immediately followed by a completely empty line. Backslash-newline is not treated specially in this mode. Again, there is no intelligence about such a sequence appearing within a string literal or comment.\u003c/p\u003e\n\u003cp\u003eIn either input mode, if you type a semicolon that is not just before or part of a command entry terminator, it is considered a command separator. When you do type a command entry terminator, the multiple statements you've entered will be executed as a single transaction.\u003c/p\u003e\n\u003cp\u003eTo quit the session, type EOF (\u003cspan class=\"keycap\"\u003e\u003cstrong\u003eControl\u003c/strong\u003e\u003c/span\u003e+\u003cspan class=\"keycap\"\u003e\u003cstrong\u003eD\u003c/strong\u003e\u003c/span\u003e, usually). If you've entered any text since the last command entry terminator, then EOF will be taken as a command entry terminator, and another EOF will be needed to exit.\u003c/p\u003e\n\u003cp\u003eNote that the single-user mode server does not provide sophisticated line-editing features (no command history, for example). Single-user mode also does not do any background processing, such as automatic checkpoints or replication.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-POSTGRES-EXAMPLES\"\u003e\n\u003ch2\u003eExamples\u003c/h2\u003e\n\u003cp\u003eTo start \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e in the background using default values, type:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003enohup postgres \u0026gt;logfile 2\u0026gt;\u0026amp;1 \u0026lt;/dev/null \u0026amp;\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo start \u003ccode class=\"command\"\u003epostgres\u003c/code\u003e with a specific port, e.g., 1234:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epostgres -p 1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eTo connect to this server using \u003cspan class=\"application\"\u003epsql\u003c/span\u003e, specify this port with the -p option:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epsql -p 1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eor set the environment variable \u003ccode class=\"envar\"\u003ePGPORT\u003c/code\u003e:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003eexport PGPORT=1234\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epsql\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eNamed run-time parameters can be set in either of these styles:\u003c/p\u003e\n\u003cpre class=\"screen\"\u003e\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epostgres -c work_mem=1234\u003c/code\u003e\u003c/strong\u003e\n\u003ccode class=\"prompt\"\u003e$\u003c/code\u003e \u003cstrong class=\"userinput\"\u003e\u003ccode\u003epostgres --work-mem=1234\u003c/code\u003e\u003c/strong\u003e\n\u003c/pre\u003e\n\u003cp\u003eEither form overrides whatever setting might exist for \u003ccode class=\"varname\"\u003ework_mem\u003c/code\u003e in \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e. Notice that underscores in parameter names can be written as either underscore or dash on the command line. Except for short-term experiments, it's probably better practice to edit the setting in \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e than to rely on a command-line switch to set a parameter.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.5.16.13\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\n\u003cp\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-pg-ctl.html\" title=\"pg_ctl\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_ctl\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/p\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":"-B nbuffers","url":"/docs/18/app-postgres.html"},"summary":"Sets the number of shared buffers for use by the server processes. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the shared_buffers configuration parameter."},{"signature":{"text":"-c name = value","url":"/docs/18/app-postgres.html"},"summary":"Sets a named run-time parameter. The configuration parameters supported by PostgreSQL are described in Chapter 19 . Most of the other command line options are in fact short forms of such a parameter assignment. -c can appear multiple times to set multiple parameters."},{"signature":{"text":"-C name","url":"/docs/18/app-postgres.html"},"summary":"Prints the value of the named run-time parameter, and exits. (See the -c option above for details.) This returns values from postgresql.conf , modified by any parameters supplied in this invocation. It does not reflect parameters supplied when the cluster was started."},{"signature":{"text":"-d debug-level","url":"/docs/18/app-postgres.html"},"summary":"Sets the debug level. The higher this value is set, the more debugging output is written to the server log. Values are from 1 to 5. It is also possible to pass -d 0 for a specific session, which will prevent the server log level of the parent postgres process from being propagated to this session."},{"signature":{"text":"-D datadir","url":"/docs/18/app-postgres.html"},"summary":"Specifies the file system location of the database configuration files. See Section 19.2 for details."},{"signature":{"text":"-e","url":"/docs/18/app-postgres.html"},"summary":"Sets the default date style to “ European ” , that is DMY ordering of input date fields. This also causes the day to be printed before the month in certain date output formats. See Section 8.5 for more information."},{"signature":{"text":"-F","url":"/docs/18/app-postgres.html"},"summary":"Disables fsync calls for improved performance, at the risk of data corruption in the event of a system crash. Specifying this option is equivalent to disabling the fsync configuration parameter. Read the detailed documentation before using this!"},{"signature":{"text":"-h hostname","url":"/docs/18/app-postgres.html"},"summary":"Specifies the IP host name or address on which postgres is to listen for TCP/IP connections from client applications. The value can also be a comma-separated list of addresses, or * to specify listening on all available interfaces. An empty value specifies not listening on any IP addresses, in which case only Unix-domain sockets can be used to connect to the server. Defaults to listening only on localhost . Specifying this option is equivalent to setting the listen_addresses configuration parameter."},{"signature":{"text":"-i","url":"/docs/18/app-postgres.html"},"summary":"Allows remote clients to connect via TCP/IP (Internet domain) connections. Without this option, only local connections are accepted. This option is equivalent to setting listen_addresses to * in postgresql.conf or via -h ."},{"signature":{"text":"-k directory","url":"/docs/18/app-postgres.html"},"summary":"Specifies the directory of the Unix-domain socket on which postgres is to listen for connections from client applications. The value can also be a comma-separated list of directories. An empty value specifies not listening on any Unix-domain sockets, in which case only TCP/IP sockets can be used to connect to the server. The default value is normally /tmp , but that can be changed at build time. Specifying this option is equivalent to setting the unix_socket_directories configuration parameter."},{"signature":{"text":"-l","url":"/docs/18/app-postgres.html"},"summary":"Enables secure connections using SSL . PostgreSQL must have been compiled with support for SSL for this option to be available. For more information on using SSL , refer to Section 18.9 ."},{"signature":{"text":"-N max-connections","url":"/docs/18/app-postgres.html"},"summary":"Sets the maximum number of client connections that this server will accept. The default value of this parameter is chosen automatically by initdb . Specifying this option is equivalent to setting the max_connections configuration parameter."},{"signature":{"text":"-p port","url":"/docs/18/app-postgres.html"},"summary":"Specifies the TCP/IP port or local Unix domain socket file extension on which postgres is to listen for connections from client applications. Defaults to the value of the PGPORT environment variable, or if PGPORT is not set, then defaults to the value established during compilation (normally 5432). If you specify a port other than the default port, then all client applications must specify the same port using either command-line options or PGPORT ."},{"signature":{"text":"-s","url":"/docs/18/app-postgres.html"},"summary":"Print time information and other statistics at the end of each command. This is useful for benchmarking or for use in tuning the number of buffers."},{"signature":{"text":"-S work-mem","url":"/docs/18/app-postgres.html"},"summary":"Specifies the base amount of memory to be used by sorts and hash tables before resorting to temporary disk files. See the description of the work_mem configuration parameter in Section 19.4.1 ."},{"signature":{"text":"-V --version","url":"/docs/18/app-postgres.html"},"summary":"Print the postgres version and exit."},{"signature":{"text":"-- name = value","url":"/docs/18/app-postgres.html"},"summary":"Sets a named run-time parameter; a shorter form of -c ."},{"signature":{"text":"--describe-config","url":"/docs/18/app-postgres.html"},"summary":"This option dumps out the server's internal configuration variables, descriptions, and defaults in tab-delimited COPY format. It is designed primarily for use by administration tools."},{"signature":{"text":"-? --help","url":"/docs/18/app-postgres.html"},"summary":"Show help about postgres command line arguments, and exit."},{"signature":{"text":"-f { s | i | o | b | t | n | m | h }","url":"/docs/18/app-postgres.html"},"summary":"Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, o , b and t disable index-only scans, bitmap index scans, and TID scans respectively, while n , m , and h disable nested-loop, merge and hash joins respectively."},{"signature":{"text":"-O","url":"/docs/18/app-postgres.html"},"summary":"Allows the structure of system tables to be modified. This is used by initdb ."},{"signature":{"text":"-P","url":"/docs/18/app-postgres.html"},"summary":"Ignore system indexes when reading system tables, but still update the indexes when modifying the tables. This is useful when recovering from damaged system indexes."},{"signature":{"text":"-t pa[rser] | pl[anner] | e[xecutor]","url":"/docs/18/app-postgres.html"},"summary":"Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the -s option."},{"signature":{"text":"-T","url":"/docs/18/app-postgres.html"},"summary":"This option is for debugging problems that cause a server process to die abnormally. The ordinary strategy in this situation is to notify all other server processes that they must terminate, by sending them SIGQUIT signals. With this option, SIGABRT will be sent instead, resulting in production of core dump files."},{"signature":{"text":"-v protocol","url":"/docs/18/app-postgres.html"},"summary":"Specifies the version number of the frontend/backend protocol to be used for a particular session. This option is for internal use only."},{"signature":{"text":"-W seconds","url":"/docs/18/app-postgres.html"},"summary":"A delay of this many seconds occurs when a new server process is started, after it conducts the authentication procedure. This is intended to give an opportunity to attach to the server process with a debugger."},{"signature":{"text":"--single","url":"/docs/18/app-postgres.html"},"summary":"Selects the single-user mode. This must be the first argument on the command line."},{"signature":{"text":"-E","url":"/docs/18/app-postgres.html"},"summary":"Echo all commands to standard output before executing them."},{"signature":{"text":"-j","url":"/docs/18/app-postgres.html"},"summary":"Use semicolon followed by two newlines, rather than just newline, as the command entry terminator."},{"signature":{"text":"-r filename","url":"/docs/18/app-postgres.html"},"summary":"Send all server log output to filename . This option is only honored when supplied as a command-line option."}],"title":"Documented options"},{"columns":[{"key":"name","label":"Variable"},{"key":"description","label":"Meaning"}],"key":"environment","rows":[{"description":"Default character encoding used by clients. (The clients can override this individually.) This value can also be set in the configuration file.","name":"PGCLIENTENCODING"},{"description":"Default data directory location","name":"PGDATA"},{"description":"Default value of the DateStyle run-time parameter. (The use of this environment variable is deprecated.)","name":"PGDATESTYLE"},{"description":"Default port number (preferably set in the configuration file)","name":"PGPORT"}],"title":"Environment variables"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
