Commit eeb21891 authored by Tom Lane's avatar Tom Lane

Fix erroneous implementation of -s in postmaster.c (the switch doesn't take

an optarg).  Add some comments noting that code in three different files has
to be kept in sync.  Fix erroneous description of -S switch (it sets work_mem
not silent_mode), and do some light copy-editing elsewhere in postgres-ref.
parent d6061d2f
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.47 2006/06/18 15:38:36 petere Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.48 2007/01/04 00:57:51 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -51,15 +51,14 @@ PostgreSQL documentation ...@@ -51,15 +51,14 @@ PostgreSQL documentation
<option>-D</option> option or the <envar>PGDATA</envar> environment <option>-D</option> option or the <envar>PGDATA</envar> environment
variable; there is no default. Typically, <option>-D</option> or variable; there is no default. Typically, <option>-D</option> or
<envar>PGDATA</envar> points directly to the data area directory <envar>PGDATA</envar> points directly to the data area directory
created by <application>initdb</>. Other possible file layouts are created by <xref linkend="app-initdb">. Other possible file layouts are
discussed in <xref linkend="runtime-config-file-locations">. A discussed in <xref linkend="runtime-config-file-locations">.
data area is created with <xref linkend="app-initdb">.
</para> </para>
<para> <para>
By default <command>postgres</command> starts in the By default <command>postgres</command> starts in the
foreground and prints log messages to the standard error stream. In foreground and prints log messages to the standard error stream. In
practical applications the <command>postgres</command> practical applications <command>postgres</command>
should be started as a background process, perhaps at boot time. should be started as a background process, perhaps at boot time.
</para> </para>
...@@ -67,18 +66,18 @@ PostgreSQL documentation ...@@ -67,18 +66,18 @@ PostgreSQL documentation
The <command>postgres</command> command can also be called in The <command>postgres</command> command can also be called in
single-user mode. The primary use for this mode is during single-user mode. The primary use for this mode is during
bootstrapping by <xref linkend="app-initdb">. Sometimes it is used bootstrapping by <xref linkend="app-initdb">. 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 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 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 for developers than end users. In the single-user mode,
server is not truly suitable for debugging the server since no the session user will be set to the user with ID 1, and implicit
realistic interprocess communication and locking will happen. When superuser powers are granted to this user.
running a stand-alone server, the session user will be set to the This user does not actually have to exist, so the single-user mode
user with ID 1. This user does not actually have to exist, so a can be used to manually recover from certain
stand-alone server can be used to manually recover from certain kinds of accidental damage to the system catalogs.
kinds of accidental damage to the system catalogs. Implicit
superuser powers are granted to the user with ID 1 in single-user
mode.
</para> </para>
</refsect1> </refsect1>
...@@ -148,7 +147,7 @@ PostgreSQL documentation ...@@ -148,7 +147,7 @@ PostgreSQL documentation
debugging output is written to the server log. Values are debugging output is written to the server log. Values are
from 1 to 5. It is also possible to pass <literal>-d from 1 to 5. It is also possible to pass <literal>-d
0</literal> for a specific session, which will prevent the 0</literal> for a specific session, which will prevent the
server log level of the <command>postgres</> from being server log level of the parent <command>postgres</> process from being
propagated to this session. propagated to this session.
</para> </para>
</listitem> </listitem>
...@@ -187,11 +186,6 @@ PostgreSQL documentation ...@@ -187,11 +186,6 @@ PostgreSQL documentation
disabling the <xref linkend="guc-fsync"> configuration disabling the <xref linkend="guc-fsync"> configuration
parameter. Read the detailed documentation before using this! parameter. Read the detailed documentation before using this!
</para> </para>
<para>
<option>--fsync=true</option> has the opposite effect
of this option.
</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -206,7 +200,7 @@ PostgreSQL documentation ...@@ -206,7 +200,7 @@ PostgreSQL documentation
listening on all available interfaces. An empty value listening on all available interfaces. An empty value
specifies not listening on any IP addresses, in which case specifies not listening on any IP addresses, in which case
only Unix-domain sockets can be used to connect to the only Unix-domain sockets can be used to connect to the
<command>postgres</command>. Defaults to listening only on server. Defaults to listening only on
<systemitem class="systemname">localhost</systemitem>. <systemitem class="systemname">localhost</systemitem>.
Specifying this option is equivalent to setting the <xref Specifying this option is equivalent to setting the <xref
linkend="guc-listen-addresses"> configuration parameter. linkend="guc-listen-addresses"> configuration parameter.
...@@ -262,7 +256,7 @@ PostgreSQL documentation ...@@ -262,7 +256,7 @@ PostgreSQL documentation
<listitem> <listitem>
<para> <para>
Sets the maximum number of client connections that this Sets the maximum number of client connections that this
<command>postgres</command> will accept. By server will accept. By
default, this value is 32, but it can be set as high as your default, this value is 32, but it can be set as high as your
system will support. (Note that system will support. (Note that
<option>-B</option> is required to be at least twice <option>-B</option> is required to be at least twice
...@@ -281,14 +275,14 @@ PostgreSQL documentation ...@@ -281,14 +275,14 @@ PostgreSQL documentation
The command line-style options specified in <replaceable The command line-style options specified in <replaceable
class="parameter">extra-options</replaceable> are passed to class="parameter">extra-options</replaceable> are passed to
all server processes started by this all server processes started by this
<command>postgres</command>. If the option string contains <command>postgres</command> process. If the option string contains
any spaces, the entire string must be quoted. any spaces, the entire string must be quoted.
</para> </para>
<para> <para>
The use of this option is obsolete; all command-line options The use of this option is obsolete; all command-line options
for server processes can be specified directly on the for server processes can be specified directly on the
<command>postgres</command> command line <command>postgres</command> command line.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -322,24 +316,13 @@ PostgreSQL documentation ...@@ -322,24 +316,13 @@ PostgreSQL documentation
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-S</option></term> <term><option>-S</option> <replaceable class="parameter">work-mem</replaceable></term>
<listitem> <listitem>
<para> <para>
Specifies that the <command>postgres</command> Specifies the amount of memory to be used by internal sorts and hashes
process should start up in silent mode. That is, it will before resorting to temporary disk files. See the description of the
disassociate from the user's (controlling) terminal, start its <varname>work_mem</> configuration parameter in <xref
own process group, and redirect its standard output and linkend="runtime-config-resource-memory">.
standard error to <filename>/dev/null</filename>.
</para>
<para>
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
<command>postgres</command> in the background.
</para>
<para>
<option>--silent-mode=false</option> has the opposite effect
of this option.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -497,8 +480,8 @@ PostgreSQL documentation ...@@ -497,8 +480,8 @@ PostgreSQL documentation
<term><option>-y</option> <replaceable class="parameter">database</replaceable></term> <term><option>-y</option> <replaceable class="parameter">database</replaceable></term>
<listitem> <listitem>
<para> <para>
Indicates that this is a subprocess started by Indicates that this is a subprocess started by a parent
<command>postgres</command> and specifies the database to <command>postgres</command> process, and specifies the database to
use. This option is for internal use only. use. This option is for internal use only.
</para> </para>
</listitem> </listitem>
...@@ -795,8 +778,7 @@ PostgreSQL documentation ...@@ -795,8 +778,7 @@ PostgreSQL documentation
</screen> </screen>
This command will start up <command>postgres</command> This command will start up <command>postgres</command>
communicating through the port 1234. In order to connect to this communicating through the port 1234. In order to connect to this
<command>postgres</command> using <application>psql</>, you would need to server using <application>psql</>, you would need to run it as
run it as
<screen> <screen>
<prompt>$</prompt> <userinput>psql -p 1234</userinput> <prompt>$</prompt> <userinput>psql -p 1234</userinput>
</screen> </screen>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -258,7 +258,10 @@ startup_hacks(const char *progname)
} }
/*
* Help display should match the options accepted by PostmasterMain()
* and PostgresMain().
*/
static void static void
help(const char *progname) help(const char *progname)
{ {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* *
...@@ -415,6 +415,11 @@ PostmasterMain(int argc, char *argv[]) ...@@ -415,6 +415,11 @@ PostmasterMain(int argc, char *argv[])
opterr = 1; 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) while ((opt = getopt(argc, argv, "A:B:c:D:d:EeFf:h:ijk:lN:nOo:Pp:r:S:sTt:W:-:")) != -1)
{ {
switch (opt) switch (opt)
...@@ -513,7 +518,7 @@ PostmasterMain(int argc, char *argv[]) ...@@ -513,7 +518,7 @@ PostmasterMain(int argc, char *argv[])
break; break;
case 's': case 's':
SetConfigOption("log_statement_stats", optarg, PGC_POSTMASTER, PGC_S_ARGV); SetConfigOption("log_statement_stats", "true", PGC_POSTMASTER, PGC_S_ARGV);
break; break;
case 'T': case 'T':
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
...@@ -2756,6 +2756,11 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -2756,6 +2756,11 @@ PostgresMain(int argc, char *argv[], const char *username)
ctx = PGC_POSTMASTER; ctx = PGC_POSTMASTER;
gucsource = PGC_S_ARGV; /* initial switches came from command line */ 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) 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) switch (flag)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment