.\\" auto-generated by docbook2man-spec $Revision: 1.25 $ .TH "POSTMASTER" "1" "2002-11-22" "Application" "PostgreSQL Server Applications" .SH NAME postmaster \- PostgreSQL multiuser database server .SH SYNOPSIS .sp \fBpostmaster\fR\fR [ \fR\fB-A \fR\fB 0\fR | \fB1\fR\fB \fR\fR]\fR\fR [ \fR\fB-B \fInbuffers\fB \fR\fR]\fR\fR [ \fR\fB-c \fIname\fB=\fIvalue\fB \fR\fR]\fR\fR [ \fR\fB-d \fIdebug-level\fB \fR\fR]\fR\fR [ \fR\fB-D \fIdatadir\fB \fR\fR]\fR\fR [ \fR\fB-F \fR\fR]\fR\fR [ \fR\fB-h \fIhostname\fB \fR\fR]\fR\fR [ \fR\fB-i \fR\fR]\fR\fR [ \fR\fB-k \fIdirectory\fB \fR\fR]\fR\fR [ \fR\fB-l \fR\fR]\fR\fR [ \fR\fB-N \fImax-connections\fB \fR\fR]\fR\fR [ \fR\fB-o \fIextra-options\fB \fR\fR]\fR\fR [ \fR\fB-p \fIport\fB \fR\fR]\fR\fR [ \fR\fB-S \fR\fR]\fR\fR [ \fR\fB--\fIname\fB=\fIvalue\fB \fR\fR]\fR \fR[\fR \fB-n\fR\fR | \fR\fB-s\fR\fR ]\fR .SH "DESCRIPTION" .PP \fBpostmaster\fR is the PostgreSQL multiuser database server. In order for a client application to access a database it connects (over a network or locally) to a running \fBpostmaster\fR. The \fBpostmaster\fR then starts a separate server process (``\fBpostgres\fR(1)'') to handle the connection. The \fBpostmaster\fR also manages the communication among server processes. .PP By default the \fBpostmaster\fR starts in the foreground and prints log messages to the standard output. In practical applications the \fBpostmaster\fR should be started as a background process, perhaps at boot time. .PP One \fBpostmaster\fR always manages the data from exactly one database cluster. A database cluster is a collection of databases that is stored at a common file system location. When the postmaster starts it needs to know the location of the database cluster files (``data area''). This is done with the \fB-D\fR invocation option or the \fBPGDATA\fR environment variable; there is no default. More than one postmaster process can run on a system at one time, as long as they use different data areas and different communication ports (see below). A data area is created with \fBinitdb\fR(1). .SH "OPTIONS" .PP \fBpostmaster\fR accepts the following command line arguments. For a detailed discussion of the options consult the \fIAdministrator's Guide\fR. You can also save typing most of these options by setting up a configuration file. .TP \fB-A 0|1\fR Enables run-time assert checks, which is a debugging aid to detect programming mistakes. This is only available if it was enabled during compilation. If so, the default is on. .TP \fB-B \fInbuffers\fB\fR Sets the number of shared buffers for use by the server processes. This value defaults to 64 buffers, where each buffer is 8 kB. .TP \fB-c \fIname\fB=\fIvalue\fB\fR Sets a named run-time parameter. Consult the \fIAdministrator's Guide\fR for a list and descriptions. Most of the other command line options are in fact short forms of such a parameter assignment. \fB-c\fR can appear multiple times to set multiple parameters. .TP \fB-d \fIdebug-level\fB\fR 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. .TP \fB-D \fIdatadir\fB\fR Specifies the file system location of the data directory. See discussion above. .TP \fB-F\fR Disables \fBfsync\fR calls for performance improvement, at the risk of data corruption in event of a system crash. This parameter corresponds to setting fsync=false in \fIpostgresql.conf\fR. Read the detailed documentation before using this! \fB--fsync=true\fR has the opposite effect of this option. .TP \fB-h \fIhostname\fB\fR Specifies the TCP/IP host name or address on which the \fBpostmaster\fR is to listen for connections from client applications. Defaults to listening on all configured addresses (including \fBlocalhost\fR). .TP \fB-i\fR Allows clients to connect via TCP/IP (Internet domain) connections. Without this option, only local Unix domain socket connections are accepted. This option corresponds to setting tcpip_socket=true in \fIpostgresql.conf\fR. \fB--tcpip_socket=false\fR has the opposite effect of this option. .TP \fB-k \fIdirectory\fB\fR Specifies the directory of the Unix-domain socket on which the \fBpostmaster\fR is to listen for connections from client applications. The default is normally \fI/tmp\fR, but can be changed at build time. .TP \fB-l\fR Enables secure connections using SSL. The \fB-i\fR option is also required. You must have compiled with SSL enabled to use this option. .TP \fB-N \fImax-connections\fB\fR Sets the maximum number of client connections that this \fBpostmaster\fR will accept. By default, this value is 32, but it can be set as high as your system will support. (Note that \fB-B\fR is required to be at least twice \fB-N\fR. See the \fIAdministrator's Guide\fR for a discussion of system resource requirements for large numbers of client connections.) .TP \fB-o \fIextra-options\fB\fR The command line-style options specified in \fIextra-options\fR are passed to all backend server processes started by this \fBpostmaster\fR. See \fBpostgres\fR(1) for possibilities. If the option string contains any spaces, the entire string must be quoted. .TP \fB-p \fIport\fB\fR Specifies the TCP/IP port or local Unix domain socket file extension on which the \fBpostmaster\fR is to listen for connections from client applications. Defaults to the value of the \fBPGPORT\fR environment variable, or if \fBPGPORT\fR 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 \fBPGPORT\fR. .TP \fB-S\fR Specifies that the \fBpostmaster\fR process should start up in silent mode. That is, it will disassociate from the user's (controlling) terminal, start its own process group, and redirect its standard output and standard error to \fI/dev/null\fR. Using this switch discards all logging output, which is probably not what you want, since it makes it very difficult to troubleshoot problems. See below for a better way to start the \fBpostmaster\fR in the background. \fB--silent_mode=false\fR has the opposite effect of this option. .TP \fB--\fIname\fB=\fIvalue\fB\fR Sets a named run-time parameter; a shorter form of \fB-c\fR. .PP .PP Two additional command line options are available for debugging problems that cause a backend to die abnormally. These options control the behavior of the \fBpostmaster\fR in this situation, and \fBneither option is intended for use in ordinary operation\fR. .PP The ordinary strategy for this situation is to notify all other backends that they must terminate and then reinitialize the shared memory and semaphores. This is because an errant backend could have corrupted some shared state before terminating. .PP These special-case options are: .TP \fB-n\fR \fBpostmaster\fR will not reinitialize shared data structures. A knowledgeable system programmer can then use a debugger to examine shared memory and semaphore state. .TP \fB-s\fR \fBpostmaster\fR will stop all other backend processes by sending the signal SIGSTOP, but will not cause them to terminate. This permits system programmers to collect core dumps from all backend processes by hand. .PP .SH "ENVIRONMENT" .TP \fBPGCLIENTENCODING\fR Default character encoding used by clients. (The clients may override this individually.) This value can also be set in the configuration file. .TP \fBPGDATA\fR Default data direction location .TP \fBPGDATASTYLE\fR Default value of the datestyle run-time parameter. (The use of this environment variable is deprecated.) .TP \fBPGPORT\fR Default port (preferably set in the configuration file) .TP \fBTZ\fR Server time zone .TP \fBothers\fR Other environment variables may be used to designate alternative data storage locations. See the \fIAdministrator's Guide\fR for more information. .SH "DIAGNOSTICS" .PP .TP \fBsemget: No space left on device\fR If you see this message, you should run the \fBipcclean\fR command. After doing so, try starting \fBpostmaster\fR again. If this still doesn't work, you probably need to configure your kernel for shared memory and semaphores as described in the installation notes. If you run multiple instances of \fBpostmaster\fR on a single host, or have a kernel with particularly small shared memory and/or semaphore limits, you may have to reconfigure your kernel to increase its shared memory or semaphore parameters. .sp .RS .B "Tip:" You may be able to postpone reconfiguring your kernel by decreasing \fB-B\fR to reduce the shared memory consumption of PostgreSQL, and/or by reducing \fB-N\fR to reduce the semaphore consumption. .RE .sp .TP \fBStreamServerPort: cannot bind to port\fR If you see this message, you should make certain that there is no other \fBpostmaster\fR process already running on the same port number. The easiest way to determine this is by using the command .sp .nf $ \fBps ax | grep postmaster\fR .sp .fi or .sp .nf $ \fBps -e | grep postmaster\fR .sp .fi depending on your system. If you are sure that no other \fBpostmaster\fR processes are running and you still get this error, try specifying a different port using the -p option. You may also get this error if you terminate the \fBpostmaster\fR 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 may 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 \fItrusted\fR and only permit the Unix superuser to access them. .PP .SH "NOTES" .PP If at all possible, \fBdo not\fR use SIGKILL to kill the \fBpostmaster\fR. This will prevent \fBpostmaster\fR from freeing the system resources (e.g., shared memory and semaphores) that it holds before terminating. .PP To terminate the \fBpostmaster\fR normally, the signals SIGTERM, SIGINT, or SIGQUIT 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. .PP The utility command \fBpg_ctl\fR(1) can be used to start and shut down the \fBpostmaster\fR safely and comfortably. .PP The \fB--\fR options will not work on \fBFreeBSD\fR or \fBOpenBSD\fR. Use \fB-c\fR instead. This is a bug in the affected operating systems; a future release of PostgreSQL will provide a workaround if this is not fixed. .SH "EXAMPLES" .PP To start \fBpostmaster\fR in the background using default values, type: .sp .nf $ \fBnohup postmaster >logfile 2>&1