diff --git a/doc/src/sgml/ref/postgres-ref.sgml b/doc/src/sgml/ref/postgres-ref.sgml
index bbc3d29e5d..9088c87ec9 100644
--- a/doc/src/sgml/ref/postgres-ref.sgml
+++ b/doc/src/sgml/ref/postgres-ref.sgml
@@ -1,5 +1,5 @@
@@ -51,15 +51,14 @@ PostgreSQL documentation
option or the PGDATA environment
variable; there is no default. Typically, or
PGDATA points directly to the data area directory
- created by initdb>. Other possible file layouts are
- discussed in . A
- data area is created with .
+ created by . Other possible file layouts are
+ discussed in .
By default postgres starts in the
foreground and prints log messages to the standard error stream. In
- practical applications the postgres
+ practical applications postgres
should be started as a background process, perhaps at boot time.
@@ -67,18 +66,18 @@ PostgreSQL documentation
The postgres command can also be called in
single-user mode. The primary use for this mode is during
bootstrapping by . Sometimes it is used
- for debugging or disaster recovery. When invoked in interactive
+ for debugging or disaster recovery (but 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. But 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
- running a stand-alone server, the session user will be set to the
- user with ID 1. This user does not actually have to exist, so a
- stand-alone server can be used to manually recover from certain
- kinds of accidental damage to the system catalogs. Implicit
- superuser powers are granted to the user with ID 1 in single-user
- mode.
+ 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.
@@ -118,10 +117,10 @@ PostgreSQL documentation
- Sets the number of shared buffers for use by the server
- processes. The default value of this parameter is chosen
- automatically by initdb; refer to for more information.
+ Sets the number of shared buffers for use by the server
+ processes. The default value of this parameter is chosen
+ automatically by initdb; refer to for more information.
@@ -148,7 +147,7 @@ PostgreSQL documentation
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 postgres> from being
+ server log level of the parent postgres> process from being
propagated to this session.
@@ -170,9 +169,9 @@ PostgreSQL documentation
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 for more information.
+ DMY> ordering of input date fields. This also causes
+ the day to be printed before the month in certain date output formats.
+ See for more information.
@@ -187,11 +186,6 @@ PostgreSQL documentation
disabling the configuration
parameter. Read the detailed documentation before using this!
-
-
- has the opposite effect
- of this option.
-
@@ -206,7 +200,7 @@ PostgreSQL documentation
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
- postgres. Defaults to listening only on
+ server. Defaults to listening only on
localhost.
Specifying this option is equivalent to setting the configuration parameter.
@@ -236,10 +230,10 @@ PostgreSQL documentation
- Specifies the directory of the Unix-domain socket on which
- postgres is to listen for
- connections from client applications. The default is normally
- /tmp, but can be changed at build time.
+ Specifies the directory of the Unix-domain socket on which
+ postgres is to listen for
+ connections from client applications. The default is normally
+ /tmp, but can be changed at build time.
@@ -248,11 +242,11 @@ PostgreSQL documentation
- 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 .
+ 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 .
@@ -261,15 +255,15 @@ PostgreSQL documentation
- Sets the maximum number of client connections that this
- postgres will accept. By
- default, this value is 32, but it can be set as high as your
- system will support. (Note that
- is required to be at least twice
- . See for a discussion of
- system resource requirements for large numbers of client
- connections.) Specifying this option is equivalent to setting the
- configuration parameter.
+ Sets the maximum number of client connections that this
+ server will accept. By
+ default, this value is 32, but it can be set as high as your
+ system will support. (Note that
+ is required to be at least twice
+ . See for a discussion of
+ system resource requirements for large numbers of client
+ connections.) Specifying this option is equivalent to setting the
+ configuration parameter.
@@ -278,17 +272,17 @@ PostgreSQL documentation
- The command line-style options specified in extra-options are passed to
- all server processes started by this
- postgres. If the option string contains
- any spaces, the entire string must be quoted.
+ The command line-style options specified in extra-options are passed to
+ all server processes started by this
+ postgres process. If the option string contains
+ any spaces, the entire string must be quoted.
The use of this option is obsolete; all command-line options
for server processes can be specified directly on the
- postgres command line
+ postgres command line.
@@ -297,15 +291,15 @@ PostgreSQL documentation
- 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.
+ 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.
@@ -314,32 +308,21 @@ PostgreSQL documentation
- 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.
+ 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.
-
+ work-mem
- Specifies that the postgres
- 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
- postgres in the background.
-
-
- has the opposite effect
- of this option.
+ Specifies the amount of memory to be used by internal sorts and hashes
+ before resorting to temporary disk files. See the description of the
+ work_mem> configuration parameter in .
@@ -385,13 +368,13 @@ PostgreSQL documentation
{ s | i | m | n | h }
- Forbids the use of particular scan and join methods:
- s and i
- disable sequential and index scans respectively, while
- n, m, and h
- disable nested-loop, merge and hash joins respectively.
+ Forbids the use of particular scan and join methods:
+ s and i
+ disable sequential and index 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
@@ -423,8 +406,8 @@ PostgreSQL documentation
- Allows the structure of system tables to be modified. This is
- used by initdb.
+ Allows the structure of system tables to be modified. This is
+ used by initdb.
@@ -433,9 +416,9 @@ PostgreSQL documentation
- 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.
+ 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.
@@ -444,9 +427,9 @@ PostgreSQL documentation
pa[rser] | pl[anner] | e[xecutor]
- Print timing statistics for each query relating to each of the
- major system modules. This option cannot be used together
- with the option.
+ Print timing statistics for each query relating to each of the
+ major system modules. This option cannot be used together
+ with the option.
@@ -474,9 +457,9 @@ PostgreSQL documentation
protocol
- Specifies the version number of the frontend/backend protocol
- to be used for a particular session. This option is for
- internal use only.
+ Specifies the version number of the frontend/backend protocol
+ to be used for a particular session. This option is for
+ internal use only.
@@ -497,9 +480,9 @@ PostgreSQL documentation
database
- Indicates that this is a subprocess started by
- postgres and specifies the database to
- use. This option is for internal use only.
+ Indicates that this is a subprocess started by a parent
+ postgres process, and specifies the database to
+ use. This option is for internal use only.
@@ -518,8 +501,8 @@ PostgreSQL documentation
- Selects the single-user mode. This must be the first argument
- on the command line.
+ Selects the single-user mode. This must be the first argument
+ on the command line.
@@ -528,8 +511,8 @@ PostgreSQL documentation
database
- Specifies the name of the database to be accessed. If it is
- omitted it defaults to the user name.
+ Specifies the name of the database to be accessed. If it is
+ omitted it defaults to the user name.
@@ -538,7 +521,7 @@ PostgreSQL documentation
- Echo all commands.
+ Echo all commands.
@@ -547,7 +530,7 @@ PostgreSQL documentation
- Disables use of newline as a statement delimiter.
+ Disables use of newline as a statement delimiter.
@@ -556,10 +539,10 @@ PostgreSQL documentation
filename
- Send all server log output to filename. In normal multiuser
- mode, this option is ignored, and stderr> is
- used by all processes.
+ Send all server log output to filename. In normal multiuser
+ mode, this option is ignored, and stderr> is
+ used by all processes.
@@ -795,8 +778,7 @@ PostgreSQL documentation
This command will start up postgres
communicating through the port 1234. In order to connect to this
- postgres using psql>, you would need to
- run it as
+ server using psql>, you would need to run it as
$psql -p 1234
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index a750cfe9fd..28ae9ee98d 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/main/main.c,v 1.105 2006/10/04 00:29:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/main/main.c,v 1.106 2007/01/04 00:57:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -258,7 +258,10 @@ startup_hacks(const char *progname)
}
-
+/*
+ * Help display should match the options accepted by PostmasterMain()
+ * and PostgresMain().
+ */
static void
help(const char *progname)
{
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index dbe835f3d0..6810a5587e 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.505 2006/11/30 18:29:12 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.506 2007/01/04 00:57:51 tgl Exp $
*
* NOTES
*
@@ -415,6 +415,11 @@ PostmasterMain(int argc, char *argv[])
opterr = 1;
+ /*
+ * Parse command-line options. CAUTION: keep this in sync with
+ * tcop/postgres.c (the option sets should not conflict)
+ * and with the common help() function in main/main.c.
+ */
while ((opt = getopt(argc, argv, "A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1)
{
switch (opt)
@@ -513,7 +518,7 @@ PostmasterMain(int argc, char *argv[])
break;
case 's':
- SetConfigOption("log_statement_stats", optarg, PGC_POSTMASTER, PGC_S_ARGV);
+ SetConfigOption("log_statement_stats", "true", PGC_POSTMASTER, PGC_S_ARGV);
break;
case 'T':
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index f4b5d59d83..6ddc9cc1ca 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.519 2006/12/08 02:15:07 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.520 2007/01/04 00:57:51 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -2756,6 +2756,11 @@ PostgresMain(int argc, char *argv[], const char *username)
ctx = PGC_POSTMASTER;
gucsource = PGC_S_ARGV; /* initial switches came from command line */
+ /*
+ * Parse command-line options. CAUTION: keep this in sync with
+ * postmaster/postmaster.c (the option sets should not conflict)
+ * and with the common help() function in main/main.c.
+ */
while ((flag = getopt(argc, argv, "A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:v:W:y:-:")) != -1)
{
switch (flag)