+ endterm="app-initdb-title">.
+
+
+
+
Options
-
postmaster accepts the following command line arguments:
+
postmaster accepts the following
+ command line arguments. For a detailed discussion of the options
+ consult the Administrator's Guide. You can
+ also save typing most of these options by setting up a
+ configuration file.
- -B nBuffers
+ -A 0|1
- Sets the number of shared-memory disk buffers for the
- to allocate for use by the backend server processes that it
- starts. This value defaults to 64 buffers, where each buffer is 8k bytes
- (or whatever BLCKSZ is set to in src/include/config.h).
+ 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.
- -D DataDir
+ -B nbuffers
- Specifies the directory to use as the root of the tree of database
- directories. If -D is not given, the default data directory name is
- the value of the environment variable
- PGDATA.
- If PGDATA is not set, then the directory used is
- $POSTGRESHOME/data.
- If neither environment variable is set and this command-line
- option is not specified, the default directory that was
- set at compile-time is used.
+ Sets the number of shared buffers for use by the server
+ processes. This value defaults to 64 buffers, where each
+ buffer is 8 kB.
- -N maxBackends
+ -c name=value
- Sets the maximum number of backend server processes that this postmaster
- is allowed to start. By default, this value is 32, but it can be set
- as high as 1024 if your system will support that many processes.
- (Note that -B is required to be at least twice -N, so you'll need to
- increase -B if you increase -N.)
- Both the default and upper limit values for -N can be altered
- (see src/include/config.h).
+ Sets a named run-time parameter. Consult the
+ Administrator's Guide for a list and
+ descriptions. Most of the other command line options are in
+ fact short forms of such a parameter assignment.
+
+
+ On some systems it is also possible to equivalently use
+ GNU-style long options in the form
+ --name=value.
- -S
+ -d debug-level
- Specifies that the
postmaster
- process should start up in silent mode. That is, it will disassociate
- from the user's (controlling) tty, start its own process group, and
- redirect its standard output and standard error to
- /dev/null.
-
- Note that using this switch makes it very
- difficult to troubleshoot problems, since all tracing and logging
- output that would normally be generated by this postmaster and its
- child backends will be discarded.
+ Sets the debug level. The higher this value is set, the more
+ debugging output is written to the server log. The default is
+ 0, which means no debugging. Values up to 4 make sense.
- -d DebugLevel
+ -D datadir
- Determines the amount of debugging output the backend servers will
- produce.
- If DebugLevel
- is one, the postmaster will trace all connection traffic.
- Levels two and higher turn on increasing amounts of debug output
- from the backend processes, and the postmaster
- displays more information
- including the backend environment and process traffic.
- Note that unless the postmaster's standard output and standard error
- are redirected into a log file, all this output will appear on the
- controlling tty of the
postmaster.
+ Specifies the file system location of the data directory. See
+ discussion above.
- -h hostName
+ -F
- Specifies the TCP/IP hostname or address
- on which the
postmaster
- is to listen for connections from frontend applications. Defaults to
- the value of the PGHOST
- environment variable, or if PGHOST
- is not set, it defaults to listening on all configured addresses
- (including localhost).
-
- If you use a hostname do not try to run
- multiple instances of
postmaster on the
- same IP address but different ports. Doing so will result in them
- attempting (incorrectly) to use the same shared memory segments.
- Also, if you use a hostname, all of the host's IP addresses
- on which
postmaster instances are
- listening must be distinct in the two last octets.
+ Disables fsync calls for performance
+ improvement at the risk of data corruption. Read the detailed
+ documentation before using this!
+
+
+
+
+ -h hostname
+
- If you don't use this option, each instance must listen on a
- different port (via -p or PGPORT). And, of course, do
- not try to use both approaches on one host.
+ Specifies the TCP/IP hostname or address on which the
+
postmaster is to listen for
+ connections from client applications. Defaults to the value
+ of the PGHOST environment variable, or if
+ PGHOST is not set, it defaults to listening on
+ all configured addresses (including localhost).
-i
- Allows clients to connect via TCP/IP (Internet domain) connections.
- Without this option, only local Unix domain socket connections are
- accepted.
+ Allows clients to connect via TCP/IP (Internet domain)
+ connections. Without this option, only local Unix domain
+ socket connections are accepted.
- -k path
+ -k filename
- Specifies the local Unix domain socket path name
- on which the
postmaster
- is to listen for connections from frontend applications. Defaults to
- the value of the
- PGUNIXSOCKET
- environment variable, or if PGUNIXSOCKET
- is not set, then defaults to a file in /tmp
- constructed from the port number.
+ Specifies the Unix domain socket file name on which the
+
postmaster is to listen for
+ connections from client applications. Defaults to the value
+ of the PGUNIXSOCKET environment variable, or if
+ PGUNIXSOCKET is not set, then defaults to a
+ file in /tmp constructed from the port
+ number.
+
+
+
+
+ -l
+
- You can use this option to put the Unix-domain socket in a
- directory that is private to one or more users using Unix
- directory permissions. This is necessary for securely
- creating databases automatically on shared machines.
- In that situation, also disallow all TCP/IP connections
- initially in pg_hba.conf.
- If you specify a socket path other than the
- default then all frontend applications (including
-
psql) must specify the same
- socket path using either command-line options or
- PGUNIXSOCKET.
+ Enables secure connections using SSL. The
+ option is also required. You must have compiled with SSL
+ enabled to use this option.
- -l
+ -N max-connections
- Enables secure connections using SSL. The option
- is also required.
- You must have compiled with SSL enabled to use this option.
+ Sets the maximum number of client connections that this
+ postmaster will accept. By default, this value is 32, but it
+ can be set as high as 1024 if your system will support that
+ many processes. (Note that is required to
+ be at least twice .)
- -o BackendOptions
+ -o extra-options
- The
- postgres
- option(s) specified in
- BackendOptions
- are passed to all backend server processes started by this
- If the option string contains any spaces, the entire string must be
- quoted.
+ The command line-style options specified in
+ class="parameter">EXTRA-OPTIONS are passed to
+ all backend server processes started by this
+
postmaster. See
+ linkend="app-postgres" endterm="app-postgres-title"> for
+ possibilities. If the option string contains any spaces, the
+ entire string must be quoted.
-p port
- Specifies the TCP/IP port or local Unix domain socket file extension
- on which the
postmaster
- is to listen for connections from frontend applications. Defaults to
- the value of the
- PGPORT
- environment variable, or if PGPORT
- is not set, then defaults to the value established when Postgres was
- compiled (normally 5432). If you specify a port other than the
- default port, then all frontend applications (including
-
psql) must specify the same
- port using either command-line options or
- PGPORT.
+ Specifies the TCP/IP port or local Unix domain socket file
+ extension on which the
postmaster
+ 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.
+
+
+ -S
+
+ Specifies that the
postmaster
+ 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 /dev/null.
+
+ 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 postmaster in the background.
+
+
+
+
- Two additional command line options are available for debugging problems
- that cause a backend to die abnormally.
- These options control the behavior of the
-
postmaster in this situation, and
- neither option is intended for use in
- ordinary operation.
+ Two additional command line options are available for debugging
+ problems that cause a backend to die abnormally. These options
+ control the behavior of the
postmaster
+ in this situation, and neither option is intended for
+ use in ordinary operation.
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.
+ memory and semaphores. This is because an errant backend could
+ have corrupted some shared state before terminating.
-
- 1999-05-19
-
Outputs
-
semget: No space left on device
-
-
-
-
- 1999-05-19
-
-
- Description
-
-
- manages the communication between frontend and backend processes, as
- well as allocating the shared buffer pool and SysV semaphores
- (on machines without a test-and-set instruction).
- does not itself interact with the user and should be started as a
- background process.
-
+
+
+
Notes
+
- Only one postmaster should be running at a time in a given
- Here, an installation means a database directory and
-
postmaster port number.
- You can run more than one postmaster on a machine only if each one has a
- separate directory and port number.
+ If at all possible, do not use
+ SIGKILL to kill the
+
postmaster. This will prevent
+
postmaster from freeing the system
+ resources (e.g., shared memory and semaphores) that it holds before
+ terminating.
-
-
-
- 1998-10-04
-
-
- Notes
-
-
- If at all possible,
- do not
- use SIGKILL
- when killing the
postmaster.
- SIGHUP,
- SIGINT,
- or
- SIGTERM
- (the default signal for
- should be used instead. Using
-
-$ kill -KILL
-
-
-or its alternative form
-
-$ kill -9
-
-
- will prevent
postmaster
- from freeing the system resources (e.g., shared memory and semaphores)
- that it holds before dying. Use SIGTERM instead
- to avoid having to clean up manually (as described earlier).
+ To terminate the postmaster 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 lengthy shutdown, resulting in a recovery run
+ during restart.
- Useful utilities for dealing with shared memory problems include
+ The utility command can be used to
+ start and shut down the postmaster safely and comfortably.
-
-
-
- 1998-10-04
-
-
- Usage
-
- To start
postmaster using default
- values, type:
-$ nohup postmaster >logfile 2>&1 &
-
+
+
Usage
+ To start
postmaster in the background
+ using default values, type:
- This command will start up
postmaster
- on the default port (5432). This is the
- simplest and most common way to start the
+
+
$ nohup postmaster >logfile 2>&1 </dev/null &
+
- To start
postmaster with a specific port:
-
-$ nohup postmaster -p 1234 &
-
-
+ To start
postmaster with a specific
+ port:
+
+
This command will start up
postmaster
- communicating through the port 1234. In order to
- connect to this
postmaster
- using psql, you would need to run it as
-
-$ psql -p 1234
-
-
+ communicating through the port 1234. In order to connect to this
+
postmaster using psql, you would need to
+ run it as
+
+
or set the environment variable PGPORT:
-
-$ export PGPORT 1234
-$ psql
-
+
+
- KRB_SERVER_KEYFILE>
+ HOSTNAME (string)
+
+ Specifies the TCP/IP hostname or address on which the
+
postmaster is to listen for
+ connections from client applications. Defaults to the value
+ of the PGHOST environment variable, or if
+ PGHOST is not set, it defaults to listening on
+ all configured addresses (including localhost).
+
+ If you use a hostname do not try to run multiple instances of
+
postmaster on the same IP address
+ but different ports. Doing so will result in them attempting
+ (incorrectly) to use the same shared memory segments. Also,
+ if you use a hostname, all of the host's IP addresses on which
+
postmaster instances are listening
+ must be distinct in the two last octets.
+
+ If you do not use this option, then each instance must listen
+ on a different port.
+
+
+
+
+
+ KRB_SERVER_KEYFILE (string)
Sets the location of the Kerberos server key file. See
+
+ UNIXSOCKET (string)
+
+ Specifies the Unix domain socket file name on which the
+
postmaster is to listen for
+ connections from client applications. Defaults to the value
+ of the PGUNIXSOCKET environment variable, or if
+ PGUNIXSOCKET is not set, then defaults to a
+ file in /tmp constructed from the port
+ number.
+
+
+
+
UNIX_SOCKET_GROUP (string)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.185 2000/11/14 01:15:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.186 2000/11/14 18:11:31 petere Exp $
*
* NOTES
*
usage(const char *progname)
{
printf("%s is the PostgreSQL server.\n\n", progname);
- printf("Usage:\n %s [options]\n\n", progname);
+ printf("Usage:\n %s [options...]\n\n", progname);
printf("Options:\n");
#ifdef USE_ASSERT_CHECKING
- printf(" -A 1|0 enable/disable runtime assert checking\n");
+ printf(" -A 1|0 enable/disable run-time assert checking\n");
#endif
- printf(" -B number of shared buffers\n");
- printf(" -c = set run-time parameter\n");
+ printf(" -B NBUFFERS number of shared buffers (default %d)\n", DEF_NBUFFERS);
+ printf(" -c NAME=VALUE set run-time parameter\n");
printf(" -d 1-5 debugging level\n");
- printf(" -D database directory\n");
+ printf(" -D DATADIR database directory\n");
printf(" -F turn fsync off\n");
- printf(" -h hostname specify hostname or IP address\n");
+ printf(" -h HOSTNAME host name or IP address to listen to\n");
printf(" -i enable TCP/IP connections\n");
- printf(" -k path specify Unix-domain socket name\n");
+ printf(" -k FILENAME Unix domain socket location\n");
#ifdef USE_SSL
printf(" -l enable SSL connections\n");
#endif
- printf(" -N maximum number of allowed connections (1..%d, default %d)\n",
+ printf(" -N MAX-CONNECT maximum number of allowed connections (1..%d, default %d)\n",
MAXBACKENDS, DEF_MAXBACKENDS);
- printf(" -o ' to each backend server\n");
- printf(" -p
port number to listen on\n");
- printf(" -S silent mode (dissociate from tty)\n");
+ printf(" -o OPTIONS pass 'OPTIONS' to each backend server\n");
+ printf(" -p PORT port number to listen on (default %d)\n", DEF_PGPORT);
+ printf(" -S silent mode (start in background without logging output)\n");
printf("\nDeveloper options:\n");
- printf(" -n don't reinitialize shared memory after abnormal exit\n");
+ printf(" -n do not reinitialize shared memory after abnormal exit\n");
printf(" -s send SIGSTOP to all backend servers if one dies\n");
printf("\nPlease read the documentation for the complete list of run-time\n"
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.187 2000/11/08 17:57:46 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.188 2000/11/14 18:11:32 petere Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
}
+
static void
usage(char *progname)
{
- fprintf(stderr,
- "Usage: %s [options] [dbname]\n", progname);
+ printf("%s is the PostgreSQL stand-alone backend. It is not\nintended to be used by normal users.\n\n", progname);
+
+ printf("Usage:\n %s [options...] [dbname]\n\n", progname);
+ printf("Options:\n");
#ifdef USE_ASSERT_CHECKING
- fprintf(stderr, "\t-A on\t\tenable/disable assert checking\n");
+ printf(" -A 1|0 enable/disable run-time assert checking\n");
#endif
- fprintf(stderr, "\t-B buffers\tset number of buffers in buffer pool\n");
- fprintf(stderr, "\t-c name=value\tset run-time parameter\n");
- fprintf(stderr, "\t-C \t\tsuppress version info\n");
- fprintf(stderr, "\t-D dir\t\tdata directory\n");
- fprintf(stderr, "\t-E \t\techo query before execution\n");
- fprintf(stderr, "\t-F \t\tturn fsync off\n");
- fprintf(stderr, "\t-L \t\tturn off locking\n");
- fprintf(stderr, "\t-N \t\tdon't use newline as interactive query delimiter\n");
- fprintf(stderr, "\t-O \t\tallow system table structure changes\n");
- fprintf(stderr, "\t-Q \t\tsuppress informational messages\n");
- fprintf(stderr, "\t-S kbytes\tset amount of memory for sorts (in kbytes)\n");
- fprintf(stderr, "\t-T options\tspecify pg_options\n");
- fprintf(stderr, "\t-W sec\t\twait N seconds to allow attach from a debugger\n");
- fprintf(stderr, "\t-d [1-5]\tset debug level\n");
- fprintf(stderr, "\t-e \t\tturn on European date format\n");
- fprintf(stderr, "\t-f [s|i|n|m|h]\tforbid use of some plan types\n");
- fprintf(stderr, "\t-i \t\tdon't execute queries\n");
- fprintf(stderr, "\t-o file\t\tsend stdout and stderr to given filename\n");
- fprintf(stderr, "\t-p database\tbackend is started under a postmaster\n");
- fprintf(stderr, "\t-s \t\tshow stats after each query\n");
- fprintf(stderr, "\t-t [pa|pl|ex]\tshow timings after each query\n");
- fprintf(stderr, "\t-v version\tset protocol version being used by frontend\n");
+ printf(" -B NBUFFERS number of shared buffers (default %d)\n", DEF_NBUFFERS);
+ printf(" -c NAME=VALUE set run-time parameter\n");
+ printf(" -d 1-5 debugging level\n");
+ printf(" -D DATADIR database directory\n");
+ printf(" -e use European date format\n");
+ printf(" -E echo query before execution\n");
+ printf(" -F turn fsync off\n");
+ printf(" -N do not use newline as interactive query delimiter\n");
+ printf(" -o FILENAME send stdout and stderr to given file\n");
+ printf(" -P disable system indexes\n");
+ printf(" -s show statistics after each query\n");
+ printf(" -S SORT-MEM set amount of memory for sorts (in kbytes)\n");
+ printf("Developer options:\n");
+ printf(" -f [s|i|n|m|h] forbid use of some plan types\n");
+ printf(" -i do not execute queries\n");
+ printf(" -L turn off locking\n");
+ printf(" -O allow system table structure changes\n");
+ printf(" -t [pa|pl|ex] show timings after each query\n");
+ printf(" -W NUM wait NUM seconds to allow attach from a debugger\n");
+ printf("\nReport bugs to
.\n");
}
+
+
/* ----------------------------------------------------------------
* PostgresMain
* postgres main loop -- all backends, interactive or otherwise start here
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.187 $ $Date: 2000/11/08 17:57:46 $\n");
+ puts("$Revision: 1.188 $ $Date: 2000/11/14 18:11:32 $\n");
}
/*