Markup fixes.

This commit is contained in:
Thomas G. Lockhart 1999-05-27 15:49:15 +00:00
parent b805230906
commit 5b1b477cca
2 changed files with 489 additions and 232 deletions

View File

@ -1,220 +1,479 @@
.\" This is -*-nroff-*- <refentry id="APP-POSTGRES">
.\" XXX standard disclaimer belongs here.... <refmeta>
.\" $Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.1 1999/05/26 17:25:38 thomas Exp $ <refentrytitle>
.TH POSTGRESQL UNIX 05/19/99 PostgreSQL PostgreSQL <application>postgres</application>
.SH NAME </refentrytitle>
postgres - the Postgres backend server <refmiscinfo>Application</refmiscinfo>
.SH SYNOPSIS </refmeta>
.BR "postgres" <refnamediv>
[\c <refname id="postgres-ref">
.BR "-B" <application>postgres</application>
n_buffers] </refname>
[\c <refpurpose>
.BR "-C" Run a <productname>Postgres</productname> single-user backend
] </refpurpose>
[\c </refnamediv>
.BR "-D" <refsynopsisdiv>
data_directory] <refsynopsisdivinfo>
[\c <date>1999-05-19</date>
.BR "-E" </refsynopsisdivinfo>
] <synopsis>
[\c postgres [ <replaceable class="parameter">dbname</replaceable> ]
.BR "-F" postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -D <replaceable class="parameter">DataDir</replaceable> ] [ -E ] [ -F ]
] [ -O ] [ -Q ] [ -S <replaceable class="parameter">SortSize</replaceable> ] [ -d [ <replaceable class="parameter">DebugLevel</replaceable> ] ] [ -e ]
[\c [ -o ] [ <replaceable class="parameter">OutputFile</replaceable> ] [ -s ] [ -v <replaceable class="parameter">protocol</replaceable> ] [ <replaceable class="parameter">dbname</replaceable> ]
.BR "-O" </synopsis>
]
[\c <refsect2 id="R2-APP-POSTGRES-1">
.BR "-Q" <refsect2info>
] <date>1999-05-19</date>
[\c </refsect2info>
.BR "-S kbytes" <title>
] Inputs
[\c </title>
.BR "-d" <para>
debug_level] <application>postgres</application> accepts the following command line arguments:
[\c
.BR "-e" <variablelist>
] <varlistentry>
[\c <term>
.BR "-o" <replaceable class="parameter">dbname</replaceable>
output_file] </term>
[\c <listitem>
.BR "-s" <para>
] The optional argument
[\c <replaceable class="parameter">dbname</replaceable>
.BR "-v protocol" specifies the name of the database to be accessed.
] <replaceable class="parameter">dbname</replaceable>
[dbname] defaults to the value of the
.in -5n <envar>USER</envar>
.SH DESCRIPTION environment variable.
The Postgres backend server can be executed directly from the user shell. </para>
This should be done only while debugging by the DBA, and should not be </listitem>
done while other Postgres backends are being managed by a </varlistentry>
.IR postmaster
on this set of databases. <varlistentry>
.PP <term>
Some of the switches explained in this man page can be passed to the backend -B <replaceable class="parameter">nBuffers</replaceable>
through the "database options" field of a connection request, and thus can be </term>
set for a particular backend without going to the trouble of restarting the <listitem>
postmaster. This is particularly handy for debugging-related switches. <para>
.PP If the backend is running under the
The optional argument <application>postmaster</application>,
.IR dbname <replaceable class="parameter">nBuffers</replaceable>
specifies the name of the database to be accessed. is the number of shared-memory buffers that the
.IR Dbname <application>postmaster</application>
defaults to the value of the has allocated for the backend server processes that it starts. If the
.SM USER backend is running standalone, this specifies the number of buffers to
environment variable. allocate. This value defaults to 64 buffers, where each buffer is 8k bytes
.PP (or whatever BLCKSZ is set to in config.h).
The </para>
.IR postgres </listitem>
server understands the following command-line options: </varlistentry>
.TP
.BR "-B" " n_buffers" <varlistentry>
If the backend is running under the <term>
.IR postmaster , -C
.IR "n_buffers" </term>
is the number of shared-memory buffers that the <listitem>
.IR "postmaster" <para>
has allocated for the backend server processes that it starts. If the Do not show the server version number.
backend is running standalone, this specifies the number of buffers to </para>
allocate. This value defaults to 64 buffers, where each buffer is 8k bytes </listitem>
(or whatever BLCKSZ is set to in config.h). </varlistentry>
.TP
.BR "-C" <varlistentry>
Do not show server version number. <term>
.TP -D <replaceable class="parameter">DataDir</replaceable>
.BR "-D" " data_directory" </term>
This option specifies the pathname of the directory that contains the <listitem>
database system data (the tables, the catalogs, etc.). If you don't <para>
specify this option, Postgres uses the value of the PGDATA environment Specifies the directory to use as the root of the tree of database
variable. You must either specify a -D option or set PGDATA. directories. If -D is not given, the default data directory name is
the value of the environment variable
The data directory pathname for a database system is normally determined when <envar>PGDATA</envar>.
the database system is created with If <envar>PGDATA</envar> is not set, then the directory used is
.IR initdb , <filename>$POSTGRESHOME/data</filename>.
with a --pgdata option to If neither environment variable is set and this command-line
.IR initdb . option is not specified, the default directory that was
.TP set at compile-time is used.
.BR "-E" </para>
Echo all queries. </listitem>
.TP </varlistentry>
.BR "-F"
Disable automatic fsync() call after each transaction. <varlistentry>
This option improves performance, but an operating system crash <term>
while a transaction is in progress will probably cause data loss. -E
.TP </term>
.BR "-O" <listitem>
Override restrictions, so system table structures can be modified(pg_*). <para>
.TP Echo all queries.
.BR "-Q" </para>
Specifies \*(lqquiet\*(rq mode. </listitem>
.TP </varlistentry>
.BR "-S" " kbytes"
Specifies the amount of memory to be used by internal sorts and hashes <varlistentry>
before resorting to temporary disk files. The value is specified in <term>
kilobytes, and defaults to 512 kilobytes. Note that for a complex query, -F
several sorts and/or hashes might be running in parallel, and each one </term>
will be allowed to use as much as -S kilobytes before it starts to put <listitem>
data into temporary files. <para>
.TP Disable an automatic <function>fsync()</function> call after each transaction.
.BR "-e" This option improves performance, but an operating system crash
The while a transaction is in progress may cause the loss of
.IR "-e" the most recently entered data. Without the <function>fsync()</function> call
option controls how dates are input to and output from the database. the data is buffered by the operating system, and written to disk sometime later.
.IP </para>
If the </listitem>
.IR "-e" </varlistentry>
option is supplied, then all dates passed to and from the frontend
processes will be assumed to be in <varlistentry>
.IR "European" <term>
format ie. -O
.IR "DD-MM-YYYY" </term>
otherwise dates are input and output in <listitem>
.IR "American" <para>
format ie. Override restrictions, so system table structures can be modified.
.IR "MM-DD-YYYY" These tables are typically those with a leading "pg_" in the table name.
.TP </para>
.BR "-d" " debug_level" </listitem>
Turns on debugging at the numeric level </varlistentry>
.IR "debug_level" .
Turning on debugging will cause query, parse trees, and query plans to <varlistentry>
be displayed. <term>
.TP -Q
.BR "-o" " output_file" </term>
Sends all debugging and error output to <listitem>
.IR output_file . <para>
If the backend is running under the Specifies "quiet" mode.
.IR postmaster , </para>
error messages are still sent to the frontend process as well as to </listitem>
.IR output_file , </varlistentry>
but debugging output is sent to the controlling tty of the
.IR postmaster <varlistentry>
(since only one file descriptor can be sent to an actual file). <term>
.TP -S <replaceable class="parameter">SortSize</replaceable>
.BR "-s" </term>
Print time information and other statistics at the end of each query. <listitem>
This is useful for benchmarking or for use in tuning the number of <para>
buffers. Specifies the amount of memory to be used by internal sorts and hashes
.TP before resorting to temporary disk files. The value is specified in
.BR "-v" " protocol" kilobytes, and defaults to 512 kilobytes. Note that for a complex query,
Specifies the number of the frontend/backend protocol to be used for this several sorts and/or hashes might be running in parallel, and each one
particular session. will be allowed to use as much as
.SH "DEVELOPER COMMAND OPTIONS" <replaceable class="parameter">SortSize</replaceable> kilobytes
There are several other options that may be specified, used mainly before it starts to put data into temporary files.
for debugging purposes. These are listed here only for the use by </para>
Postgres system developers. </listitem>
.BR "Use of any of these options is highly discouraged" . </varlistentry>
Furthermore, any of these options may disappear or change at any time.
.TP <varlistentry>
.BR "-A" "n|r|b|Q\fIn\fP|X\fIn\fP" <term>
.IP -d [ <replaceable class="parameter">DebugLevel</replaceable> ]
This option generates a tremendous amount of output. </term>
.TP <listitem>
.BR "-L" <para>
Turns off the locking system. The optional argument <replaceable class="parameter">DebugLevel</replaceable>
.TP determines the amount of debugging output the backend servers will
.BR "-N" produce.
Disables use of newline as a query delimiter. If <replaceable class="parameter">DebugLevel</replaceable>
.TP is one, the postmaster will trace all connection traffic,
.BR "-f" and nothing else.
Forbids the use of particular scan and join methods: For levels two and higher,
.IR s " and " i debugging is turned on in the backend process and the postmaster
disable sequential and index scans respectively, while displays more information,
.IR n ", " m " and " h including the backend environment and process traffic.
disable nested-loop, merge and hash joins respectively. Note that if no file is specified for backend servers to
(Neither sequential scans nor nested-loop joins can be disabled completely; send their debugging output then this output will appear on the
the -fs and -fn options simply discourage the optimizer from using those controlling tty of their parent <application>postmaster</application>.
plan types if it has any other alternative.) </para>
.TP </listitem>
.BR "-i" </varlistentry>
Prevents query execution, but shows the plan tree.
.TP <varlistentry>
.BR "-p" " databasename" <term>
Indicates to the backend server that it has been started by a -e
.IR postmaster </term>
and make different assumptions about buffer pool management, file <listitem>
descriptors, etc. Switches following -p are restricted to those <para>
considered "secure". This option controls how dates are interpreted upon
.TP input to and output from the database.
.BR "-t" "pa[rser]|pl[anner]|e[xecutor]" If the <option>-e</option>
Print timing statistics for each query relating to each of the major option is supplied, then dates passed to and from the frontend
system modules. This option cannot be used with processes will be assumed to be in "European"
.BR "-s" . format (<literal>DD-MM-YYYY</literal>),
.SH "SEE ALSO" otherwise dates are assumed to be in
ipcclean(1), "American" format (<literal>MM-DD-YYYY</literal>).
psql(1), Dates are accepted by the backend in a wide variety of formats,
postmaster(1). and for input dates this switch mostly affects the interpretation
.SH "DIAGNOSTICS" for ambiguous cases. See <xref linkend="datatype" endterm="datatype">
Of the nigh-infinite number of error messages you may see when you for more information.
execute the backend server directly, the most common will probably be: </para>
.TP </listitem>
.BR "semget: No space left on device" </varlistentry>
If you see this message, you should run the
.IR ipcclean <varlistentry>
command. After doing this, try starting <term>
.IR postgres -o <replaceable class="parameter">OutputFile</replaceable>
again. If this still doesn't work, you probably need to configure </term>
your kernel for shared memory and semaphores as described in the <listitem>
installation notes. <para>
Sends all debugging and error output to
<replaceable class="parameter">OutputFile</replaceable>.
If the backend is running under the <application>postmaster</application>,
error messages are still sent to the frontend process as well as to
<replaceable class="parameter">OutputFile</replaceable>,
but debugging output is sent to the controlling tty of the
<application>postmaster</application>
(since only one file descriptor can be sent to an actual file).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-s
</term>
<listitem>
<para>
Print time information and other statistics at the end of each query.
This is useful for benchmarking or for use in tuning the number of
buffers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-v <replaceable class="parameter">protocol</replaceable>
</term>
<listitem>
<para>
Specifies the number of the frontend/backend protocol to be used for this
particular session.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
There are several other options that may be specified, used mainly
for debugging purposes. These are listed here only for the use by
<productname>Postgres</productname> system developers.
<emphasis>Use of any of these options is highly discouraged.</emphasis>
Furthermore, any of these options may disappear or change at any time.
</para>
<para>
These special-case options are:
<variablelist>
<varlistentry>
<term>
-A n|r|b|Q\fIn\fP|X\fIn\fP
</term>
<listitem>
<para>
This option generates a tremendous amount of output.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-L
</term>
<listitem>
<para>
Turns off the locking system.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-N
</term>
<listitem>
<para>
Disables use of newline as a query delimiter.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-f [ s | i | m | n | h ]
</term>
<listitem>
<para>
Forbids the use of particular scan and join methods:
<literal>s</literal> and <literal>i</literal>
disable sequential and index scans respectively, while
<literal>n</literal>, <literal>m</literal>, and <literal>h</literal>
disable nested-loop, merge and hash joins respectively.
<note>
<para>
Neither sequential scans nor nested-loop joins can be disabled completely;
the <literal>-fs</literal> and <literal>-fn</literal>
options simply discourage the optimizer from using those
plan types if it has any other alternative.
</para>
</note>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-i
</term>
<listitem>
<para>
Prevents query execution, but shows the plan tree.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-p <replaceable class="parameter">dbname</replaceable>
</term>
<listitem>
<para>
Indicates to the backend server that it has been started by a
<application>postmaster</application>
and make different assumptions about buffer pool management, file
descriptors, etc. Switches following -p are restricted to those
considered "secure".
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
-t pa[rser] | pl[anner] | e[xecutor]
</term>
<listitem>
<para>
Print timing statistics for each query relating to each of the major
system modules. This option cannot be used with <option>-s</option>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect2>
<refsect2 id="R2-APP-POSTGRES-2">
<refsect2info>
<date>1999-05-19</date>
</refsect2info>
<title>
Outputs
</title>
<para>
Of the nigh-infinite number of error messages you may see when you
execute the backend server directly, the most common will probably be:
<variablelist>
<varlistentry>
<term>
semget: No space left on device
</term>
<listitem>
<para>
If you see this message, you should run the
<application>ipcclean</application>
command. After doing this, try starting
<application>postmaster</application>
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 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.
<tip>
<para>
You may be able to postpone
reconfiguring your kernel by decreasing -B to reduce
<productname>Postgres</productname>' shared memory
consumption.
</para>
</tip>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect2>
</refsynopsisdiv>
<refsect1 id="R1-APP-POSTGRES-1">
<refsect1info>
<date>1999-05-19</date>
</refsect1info>
<title>
Description
</title>
<para>
The Postgres backend server can be executed directly from the user shell.
This should be done only while debugging by the DBA, and should not be
done while other Postgres backends are being managed by a
<application>postmaster</application>
on this set of databases.
</para>
<para>
Some of the switches explained here can be passed to the backend
through the "database options" field of a connection request, and thus can be
set for a particular backend without going to the trouble of restarting the
postmaster. This is particularly handy for debugging-related switches.
</para>
<para>
The optional argument <replaceable class="parameter">dbname</replaceable>
specifies the name of the database to be accessed.
<replaceable class="parameter">dbname</replaceable>
defaults to the value of the
<envar>USER</envar> environment variable.
</para>
</refsect1>
<refsect1 id="R1-APP-POSTGRES-2">
<refsect1info>
<date>1998-10-04</date>
</refsect1info>
<title>
Notes
</title>
<para>
Useful utilities for dealing with shared memory problems include
<application>ipcs(1)</application>,
<application>ipcrm(1</application>), and
<application>ipcclean(1)</application>.
See also <xref linkend="postmaster-ref" endterm="postmaster-ref">.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->

View File

@ -6,7 +6,7 @@
<refmiscinfo>Application</refmiscinfo> <refmiscinfo>Application</refmiscinfo>
</refmeta> </refmeta>
<refnamediv> <refnamediv>
<refname id="postmaster"> <refname id="postmaster-ref">
<application>postmaster</application> <application>postmaster</application>
</refname> </refname>
<refpurpose> <refpurpose>
@ -18,10 +18,9 @@
<date>1999-05-19</date> <date>1999-05-19</date>
</refsynopsisdivinfo> </refsynopsisdivinfo>
<synopsis> <synopsis>
postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <replaceable class="parameter">DataDir</replaceable> ] [ -i ]
[ -D <replaceable class="parameter">DataDir</replaceable> ] [-N <replaceable class="parameter">nBackends</replaceable> ] [ -S ] postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <replaceable class="parameter">DataDir</replaceable> ] [ -N <replaceable class="parameter">nBackends</replaceable> ] [ -S ]
[ -d [ <replaceable class="parameter">DebugLevel</replaceable> ] ] [ -d [ <replaceable class="parameter">DebugLevel</replaceable> ] [ -i ] [ -o <replaceable class="parameter">BackendOptions</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
[ -i ] [ -o <replaceable class="parameter">BackendOptions</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
postmaster [ -n | -s ] ... postmaster [ -n | -s ] ...
</synopsis> </synopsis>
@ -206,10 +205,8 @@ postmaster [ -n | -s ] ...
</term> </term>
<listitem> <listitem>
<para> <para>
If the <literal>-n</literal>
option is supplied, then the
<application>postmaster</application> <application>postmaster</application>
does not reinitialize shared data structures. A knowledgable system will not reinitialize shared data structures. A knowledgable system
programmer can then use the programmer can then use the
<application>shmemdoc</application> <application>shmemdoc</application>
program to examine shared memory and semaphore state. program to examine shared memory and semaphore state.
@ -235,7 +232,7 @@ postmaster [ -n | -s ] ...
</para> </para>
</refsect2> </refsect2>
<refsect2 id="R2-APP-POSTMASTER-1"> <refsect2 id="R2-APP-POSTMASTER-2">
<refsect2info> <refsect2info>
<date>1999-05-19</date> <date>1999-05-19</date>
</refsect2info> </refsect2info>
@ -388,8 +385,9 @@ on BSD-based systems, or
You can run more than one postmaster on a machine only if each one has a You can run more than one postmaster on a machine only if each one has a
separate directory and port number. separate directory and port number.
</para> </para>
</refsect1>
<refsect1 id="R1-APP-VACUUMDB-2"> <refsect1 id="R1-APP-POSTMASTER-2">
<refsect1info> <refsect1info>
<date>1998-10-04</date> <date>1998-10-04</date>
</refsect1info> </refsect1info>
@ -434,7 +432,7 @@ or its alternative form
</para> </para>
</refsect1> </refsect1>
<refsect1 id="R1-APP-VACUUMDB-3"> <refsect1 id="R1-APP-POSTMASTER-3">
<refsect1info> <refsect1info>
<date>1998-10-04</date> <date>1998-10-04</date>
</refsect1info> </refsect1info>
@ -478,7 +476,7 @@ or its alternative form
% setenv PGPORT 1234 % setenv PGPORT 1234
% psql % psql
</programlisting>. </programlisting>.
</para>
</refsect1> </refsect1>
</refentry> </refentry>