11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.20 2001/09/27 16:29:12 tgl Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.21 2001/11/25 01:11:36 tgl Exp $
33Postgres documentation
44-->
55
@@ -43,6 +43,7 @@ Postgres documentation
4343 </group>
4444 <arg>-S <replaceable>sort-mem</replaceable></arg>
4545 <arg>-W <replaceable>seconds</replaceable></arg>
46+ <arg>--<replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
4647 <arg choice="plain"><replaceable>database</replaceable></arg>
4748 <sbr>
4849 <!-- postmaster fork -->
@@ -67,6 +68,7 @@ Postgres documentation
6768 <arg>-S <replaceable>sort-mem</replaceable></arg>
6869 <arg>-v <replaceable>protocol-version</replaceable></arg>
6970 <arg>-W <replaceable>seconds</replaceable></arg>
71+ <arg>--<replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
7072 </cmdsynopsis>
7173 </refsynopsisdiv>
7274
@@ -87,8 +89,9 @@ Postgres documentation
8789 conceptually, since both <filename>postmaster</filename> and
8890 <filename>postgres</filename> are in fact the same program); it
8991 should not be invoked directly this way. The first form invokes
90- the server directly in interactive mode. The primary use for this
91- mode is for bootstrapping by <xref linkend="app-initdb">.
92+ the server directly in interactive single-user mode. The primary use
93+ for this mode is during bootstrapping by <xref linkend="app-initdb">.
94+ Sometimes it is used for debugging or disaster recovery.
9295 </para>
9396
9497 <para>
@@ -138,8 +141,8 @@ Postgres documentation
138141 <para>
139142 The options <option>-A</option>, <option>-B</option>,
140143 <option>-c</option>, <option>-d</option>, <option>-D</option>,
141- and <option>-F</option> have the samemeaning as with the <xref
142- linkend="app-postmaster">.
144+ <option>-F</option>, and <option>--name</> have the samemeanings as
145+ for the <xref linkend="app-postmaster">.
143146 </para>
144147
145148 <variablelist>
@@ -163,12 +166,10 @@ Postgres documentation
163166 <para>
164167Sends all debugging and error output to
165168<replaceable class="parameter">filename</replaceable>.
166- If the backend is running under the <application>postmaster</application>,
167- error messages are still sent to the frontend process as well as to
168- <replaceable class="parameter">filename</replaceable>,
169- but debugging output is sent to the controlling tty of the
170- <application>postmaster</application>
171- (since only one file descriptor can be sent to an actual file).
169+ If the backend is running under the
170+ <application>postmaster</application>, this option is ignored,
171+ and the stderr inherited from the
172+ <application>postmaster</application> is used.
172173 </para>
173174 </listitem>
174175 </varlistentry>
@@ -177,7 +178,7 @@ Postgres documentation
177178 <term>-P</term>
178179 <listitem>
179180 <para>
180- Ignore system indexesto scan/update system tuples. The
181+ Ignore system indexeswhile scanning/updating system tuples. The
181182<command>REINDEX</command> command for system tables/indexes
182183requires this option to be used.
183184 </para>
@@ -350,6 +351,46 @@ Postgres documentation
350351 </refsect2>
351352 </refsect1>
352353
354+ <refsect1>
355+ <title>Usage</title>
356+
357+ <para>
358+ Start a standalone backend with a command like
359+ <screen>
360+ <userinput>postgres -D $PGDATA <replaceable>other-options</> my_database</userinput>
361+ </screen>
362+ Provide the correct path to the database area with <option>-D</>, or
363+ make sure that the environment variable <envar>PGDATA</> is set.
364+ Also specify the name of the particular database you want to work in.
365+ </para>
366+
367+ <para>
368+ Normally, the standalone backend treats newline as the command
369+ entry terminator; there is no intelligence about semicolons,
370+ as there is in <application>psql</>. To continue a command
371+ across multiple lines, you must type backslash just before each
372+ newline except the last one.
373+ </para>
374+
375+ <para>
376+ But if you use the <option>-N</> command line switch, then newline does
377+ not terminate command entry. The backend will read stdin until EOF, then
378+ process the input as a single query string. Backslash-newline is not
379+ treated specially in this case.
380+ </para>
381+
382+ <para>
383+ The standalone backend does not have readline input processing
384+ (no command history, for example).
385+ </para>
386+
387+ <para>
388+ To quit the backend, type EOF (control-D, usually). If you've
389+ used <option>-N</>, two consecutive EOFs are needed to exit.
390+ </para>
391+
392+ </refsect1>
393+
353394 <refsect1>
354395 <title>See Also</title>
355396