Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
8a9315ca
Commit
8a9315ca
authored
Nov 14, 2000
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update and polish postmaster and postgres help output and man pages.
parent
3eaf3363
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
535 additions
and
608 deletions
+535
-608
doc/src/sgml/ref/postgres-ref.sgml
doc/src/sgml/ref/postgres-ref.sgml
+219
-292
doc/src/sgml/ref/postmaster.sgml
doc/src/sgml/ref/postmaster.sgml
+229
-274
doc/src/sgml/runtime.sgml
doc/src/sgml/runtime.sgml
+44
-2
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+13
-13
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+30
-27
No files found.
doc/src/sgml/ref/postgres-ref.sgml
View file @
8a9315ca
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.1
4 2000/10/05 19:48:18 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postgres-ref.sgml,v 1.1
5 2000/11/14 18:11:31 petere
Exp $
Postgres documentation
Postgres documentation
-->
-->
<refentry id="APP-POSTGRES">
<refentry id="APP-POSTGRES">
<docinfo>
<date>2000-11-12</date>
</docinfo>
<refmeta>
<refmeta>
<refentrytitle id="APP-POSTGRES-TITLE">
<refentrytitle id="APP-POSTGRES-TITLE"><application>postgres</application></refentrytitle>
<application>postgres</application>
<manvolnum>1</manvolnum>
</refentrytitle>
<refmiscinfo>Application</refmiscinfo>
<refmiscinfo>Application</refmiscinfo>
</refmeta>
</refmeta>
<refnamediv>
<refnamediv>
<refname>
<refname>postgres</refname>
<application>postgres</application>
<refpurpose>Run a <productname>PostgreSQL</productname> single-user backend</refpurpose>
</refname>
<refpurpose>
Run a <productname>Postgres</productname> single-user backend
</refpurpose>
</refnamediv>
</refnamediv>
<refsynopsisdiv>
<refsynopsisdiv>
<refsynopsisdivinfo>
<cmdsynopsis>
<date>1999-07-20</date>
<!-- standalone call -->
</refsynopsisdivinfo>
<command>postgres</command>
<synopsis>
<arg>-A <group choice="plain"><arg>0</arg><arg>1</arg></group></arg>
postgres [ <replaceable class="parameter">dbname</replaceable> ]
<arg>-B <replaceable>nbuffers</replaceable></arg>
postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -D <replaceable class="parameter">DataDir</replaceable> ] [ -E ] [ -F ]
<arg>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
[ -O ] [ -P ] [ -Q ] [ -S <replaceable class="parameter">SortSize</replaceable> ] [ -d [ <replaceable class="parameter">DebugLevel</replaceable> ] ] [ -e ]
<arg>-d <replaceable>debug-level</replaceable></arg>
[ -o ] [ <replaceable class="parameter">OutputFile</replaceable> ] [ -s ] [ -v <replaceable class="parameter">protocol</replaceable> ] [ <replaceable class="parameter">dbname</replaceable> ]
<arg>-D <replaceable>datadir</replaceable></arg>
</synopsis>
<arg>-e</arg>
<arg>-E</arg>
<refsect2 id="R2-APP-POSTGRES-1">
<arg>-f<group choice="plain"><arg>s</arg><arg>i</arg><arg>t</arg><arg>n</arg><arg>m</arg><arg>h</arg></group></arg>
<refsect2info>
<arg>-F</arg>
<date>1999-05-19</date>
<arg>-i</arg>
</refsect2info>
<arg>-L</arg>
<title>
<arg>-N</arg>
Inputs
<arg>-o <replaceable>file-name</replaceable></arg>
</title>
<arg>-O</arg>
<para>
<arg>-P</arg>
<application>postgres</application> accepts the following command line arguments:
<group>
<arg>-s</arg>
<variablelist>
<arg>-t<group choice="plain"><arg>pa</arg><arg>pl</arg><arg>ex</arg></group></arg>
<varlistentry>
</group>
<term><replaceable class="parameter">dbname</replaceable></term>
<arg>-S <replaceable>sort-mem</replaceable></arg>
<listitem>
<arg>-W <replaceable>seconds</replaceable></arg>
<para>
<arg choice="plain"><replaceable>database</replaceable></arg>
The optional argument
<sbr>
<replaceable class="parameter">dbname</replaceable>
<!-- postmaster fork -->
specifies the name of the database to be accessed.
<command>postgres</command>
<replaceable class="parameter">dbname</replaceable>
<arg>-A <group choice="plain"><arg>0</arg><arg>1</arg></group></arg>
defaults to the value of the
<arg>-B <replaceable>nbuffers</replaceable></arg>
<envar>USER</envar>
<arg>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
environment variable.
<arg>-d <replaceable>debug-level</replaceable></arg>
</para>
<arg>-D <replaceable>datadir</replaceable></arg>
</listitem>
<arg>-e</arg>
</varlistentry>
<arg>-f<group choice="plain"><arg>s</arg><arg>i</arg><arg>t</arg><arg>n</arg><arg>m</arg><arg>h</arg></group></arg>
<arg>-F</arg>
<arg>-i</arg>
<arg>-L</arg>
<arg>-o <replaceable>file-name</replaceable></arg>
<arg>-O</arg>
<arg>-p <replaceable>database</replaceable></arg>
<arg>-P</arg>
<group>
<arg>-s</arg>
<arg>-t<group choice="plain"><arg>pa</arg><arg>pl</arg><arg>ex</arg></group></arg>
</group>
<arg>-S <replaceable>sort-mem</replaceable></arg>
<arg>-v <replaceable>protocol-version</replaceable></arg>
<arg>-W <replaceable>seconds</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<varlistentry>
<refsect1>
<term>-B <replaceable class="parameter">nBuffers</replaceable></term>
<title>Description</title>
<listitem>
<para>
If the backend is running under the
<application>postmaster</application>,
<replaceable class="parameter">nBuffers</replaceable>
is the number of shared-memory buffers that the
<application>postmaster</application>
has allocated for the backend server processes that it starts. If the
backend is running stand-alone, this specifies the number of buffers to
allocate. This value defaults to 64 buffers, where each buffer is 8k bytes
(or whatever BLCKSZ is set to in config.h).
</para>
</listitem>
</varlistentry>
<varlistentry>
<para>
<term>-C</term>
The <filename>postgres</filename> executable is the actual
<listitem>
<productname>PostgreSQL</productname> server process that processes
<para>
queries. The second form above is how
Do not show the server version number.
<application>postgres</application> is invoked by the <xref
</para>
linkend="app-postmaster" endterm="app-postmaster-title"> (only
</listitem>
conceptually, since both <filename>postmaster</filename> and
</varlistentry>
<filename>postgres</filename> are in fact the same program); it
should not be invoked directly this way. The first form invokes
<varlistentry>
the server directly in interactive mode. The primary use for this
<term>-D <replaceable class="parameter">DataDir</replaceable></term>
mode is for bootstrapping by <xref linkend="app-initdb"
<listitem>
endterm="app-initdb-title">.
<para>
</para>
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
<envar>PGDATA</envar>.
If <envar>PGDATA</envar> is not set, then the directory used is
<filename>$POSTGRESHOME/data</filename>.
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.
</para>
</listitem>
</varlistentry>
<varlistentry
>
<para
>
<term>-E</term>
When invoked in interactive mode from the shell, the user can enter
<listitem>
queries and the results will be printed to the screen, but in a
<para>
form that is more useful for developers than end users. But note
Echo all queries.
that running a single-user backend is not truly suitable for
</para>
debugging the server since no realistic inter-process communication
</listitem>
and locking will happen.
</varlistentry
>
</para
>
<varlistentry>
<para>
<term>-F</term>
When running a stand-alone backend the session user name will
<listitem>
automatically be set to the current effective Unix user name. If
<para>
that user does not exist the server will not start.
Disable an automatic <function>fsync()</function> call after each transaction.
</para>
This option improves performance, but an operating system crash
while a transaction is in progress may cause the loss of
the most recently entered data. Without the <function>fsync()</function> call
the data is buffered by the operating system, and written to disk sometime later.
</para>
</listitem>
</varlistentry>
<varlistentry>
<refsect2>
<term>-O</term>
<title>Options</title>
<listitem>
<para>
Override restrictions, so system table structures can be modified.
These tables are typically those with a leading
<literal>pg_</literal> in the table name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<para>
<term>-P</term>
When <application>postgres</application> is started by a <xref
<listitem>
linkend="app-postmaster" endterm="app-postmaster-title"> then it
<para>
inherits all options set by the latter. Additionally,
Ignore system indexes to scan/update system
<application>postgres</application>-specific options can be passed
tuples. The <command>REINDEX</command> for system tables/indexes
from the <application>postmaster</application> with the
requires this option. System tables are
<option>-o</option> switch.
typically those with a leading <literal>pg_</literal> in the
</para>
table name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<para>
<term>-Q</term>
You can avoid having to type these options by setting up a
<listitem>
configuration file. See the <citetitle>Administrator's
<para>
Guide</citetitle> for details. Some (safe) options can also be
Specifies "quiet" mode.
set from the connecting client in an application-dependent way.
</para>
For example, if the environment variable <envar>PGOPTIONS</envar>
</listitem>
is set, then libpq-based clients will pass that string to the
</varlistentry>
server, which will interpret it as
<application>postgres</application> command-line options.
</para>
<varlistentry>
<refsect3>
<term>-S <replaceable class="parameter">SortSize</replaceable></term>
<title>General Purpose</title>
<listitem>
<para>
Specifies the amount of memory to be used by internal sorts and hashes
before resorting to temporary disk files. The value is specified in
kilobytes, and defaults to 512 kilobytes. Note that for a complex query,
several sorts and/or hashes might be running in parallel, and each one
will be allowed to use as much as
<replaceable class="parameter">SortSize</replaceable> kilobytes
before it starts to put data into temporary files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<para>
<term>-d [ <replaceable class="parameter">DebugLevel</replaceable> ]</term>
The options <option>-A</option>, <option>-B</option>,
<listitem>
<option>-c</option>, <option>-d</option>, <option>-D</option>,
<para>
and <option>-F</option> have the same meaning as with the <xref
The optional argument <replaceable class="parameter">DebugLevel</replaceable>
linkend="app-postmaster" endterm="app-postmaster-title">.
determines the amount of debugging output the backend servers will
</para>
produce.
If <replaceable class="parameter">DebugLevel</replaceable>
is one, the postmaster will trace all connection traffic,
and nothing else.
For levels two and higher,
debugging is turned on in the backend process and the postmaster
displays more information,
including the backend environment and process traffic.
Note that if no file is specified for backend servers to
send their debugging output then this output will appear on the
controlling tty of their parent <application>postmaster</application>.
</para>
</listitem>
</varlistentry>
<variablelist>
<varlistentry>
<varlistentry>
<term>-e</term>
<term>-e</term>
<listitem>
<listitem>
<para>
<para>
This option controls how dates are interpreted upon
Sets the default date style to <quote>European</quote>, which
input to and output from the database.
means that the <quote>day before month</quote> (rather than
If the <option>-e</option>
month before day) rule is used to interpret ambiguous date
option is supplied, then dates passed to and from the frontend
input, and that the day is printed before the month in certain
processes will be assumed to be in "European"
date output formats. See the <citetitle>PostgreSQL User's
format (<literal>DD-MM-YYYY</literal>),
Guide</citetitle> for more information.
otherwise dates are assumed to be in
"American" format (<literal>MM-DD-YYYY</literal>).
Dates are accepted by the backend in a wide variety of formats,
and for input dates this switch mostly affects the interpretation
for ambiguous cases.
See the <citetitle>PostgreSQL User's Guide</citetitle>
for more information.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-o <replaceable class="parameter">
OutputFil
e</replaceable></term>
<term>-o <replaceable class="parameter">
file-nam
e</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Sends all debugging and error output to
Sends all debugging and error output to
...
@@ -226,6 +168,17 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
...
@@ -226,6 +168,17 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<term>-P</term>
<listitem>
<para>
Ignore system indexes to scan/update system tuples. The
<command>REINDEX</command> command for system tables/indexes
requires this option to be used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-s</term>
<term>-s</term>
<listitem>
<listitem>
...
@@ -238,43 +191,42 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
...
@@ -238,43 +191,42 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
v <replaceable class="parameter">protocol
</replaceable></term>
<term>-
S <replaceable class="parameter">sort-mem
</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Specifies the number of the frontend/backend protocol to be used for this
Specifies the amount of memory to be used by internal sorts and hashes
particular session.
before resorting to temporary disk files. The value is specified in
kilobytes, and defaults to 512 kilobytes. Note that for a complex query,
several sorts and/or hashes might be running in parallel, and each one
will be allowed to use as much as
<replaceable class="parameter">sort-mem</replaceable> kilobytes
before it starts to put data into temporary files.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</para>
<para>
</variablelist>
There are several other options that may be specified, used mainly
</refsect3>
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
>
<
refsect3
>
These special-case options are:
<title>Options for stand-alone mode</title>
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>
-A [ n | r | b | Q | X ]
</term>
<term>
<replaceable class="parameter">database</replaceable>
</term>
<listitem>
<listitem>
<para>
<para>
This option generates a tremendous amount of output.
Specifies the name of the database to be accessed. If it is
omitted it defaults to the user name.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
L
</term>
<term>-
E
</term>
<listitem>
<listitem>
<para>
<para>
Turns off the locking system
.
Echo all queries
.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -287,6 +239,21 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
...
@@ -287,6 +239,21 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</refsect3>
<refsect3>
<title>Semi-internal Options</title>
<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>PostgreSQL</productname> system
developers. <emphasis>Use of any of these options is highly
discouraged.</emphasis> Furthermore, any of these options may
disappear or change in a future release without notice.
</para>
<variablelist>
<varlistentry>
<varlistentry>
<term>-f [ s | i | m | n | h ]</term>
<term>-f [ s | i | m | n | h ]</term>
...
@@ -320,123 +287,83 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
...
@@ -320,123 +287,83 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
p <replaceable class="parameter">dbname</replaceable>
</term>
<term>-
L
</term>
<listitem>
<listitem>
<para>
<para>
Indicates to the backend server that it has been started by a
Turns off the locking system.
<application>postmaster</application>
and makes different assumptions about buffer pool management, file
descriptors, etc. Switches following -p are restricted to those
considered "secure".
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
t pa[rser] | pl[anner] | e[xecutor]
</term>
<term>-
O
</term>
<listitem>
<listitem>
<para>
<para>
Print timing statistics for each query relating to each of the major
Allows the structure of system tables to be modified. This is
system modules. This option cannot be used with <option>-s</op
tion>.
used by <application>initdb</applica
tion>.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</para>
</refsect2>
<refsect2 id="R2-APP-POSTGRES-2">
<varlistentry>
<refsect2info>
<term>-p <replaceable class="parameter">database</replaceable></term>
<date>1999-05-19</date>
<listitem>
</refsect2info>
<para>
<title>
Indicates that this server has been started by a
Outputs
<application>postmaster</application> and makes different
</title>
assumptions about buffer pool management, file descriptors,
<para>
etc.
Of the nigh-infinite number of error messages you may see when you
</para>
execute the backend server directly, the most common will probably be:
</listitem>
</varlistentry>
<variablelist>
<varlistentry>
<varlistentry>
<term><computeroutput>
<term>-t pa[rser] | pl[anner] | e[xecutor]</term>
semget: No space left on device
</computeroutput></term>
<listitem>
<listitem>
<para>
<para>
If you see this message, you should run the
Print timing statistics for each query relating to each of the
<application>ipcclean</application>
major system modules. This option cannot be used together
command. After doing this, try starting
with the <option>-s</option> option.
<application>postmaster</application>
</para>
again. If this still doesn't work, you probably need to configure
</listitem>
your kernel for shared memory and semaphores as described in the
</varlistentry>
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>
<varlistentry>
<para>
<term>-v <replaceable class="parameter">protocol</replaceable></term>
You may be able to postpone
<listitem>
reconfiguring your kernel by decreasing -B to reduce
<para>
<productname>Postgres</productname>' shared memory
Specifies the version number of the frontend/backend protocol
consumption.
to be used for this particular session.
</para>
</tip>
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</para>
</refsect2>
</refsynopsisdiv>
<refsect1 id="R1-APP-POSTGRES-1">
<varlistentry>
<refsect1info>
<term>-W <replaceable class="parameter">seconds</replaceable></term>
<date>1999-05-19</date>
<listitem>
</refsect1info>
<para>
<title>
As soon as this option is encountered, the process sleeps for
Description
the specified amount of seconds. This gives developers time
</title>
to attach a debugger to the backend process.
</para>
</listitem>
</varlistentry>
<para>
</variablelist>
The Postgres backend server can be executed directly from the user shell.
</refsect3>
This should be done only while debugging by the DBA, and should not be
</refsect2>
done while other Postgres backends are being managed by a
</refsect1>
<application>postmaster</application>
on this set of databases.
</para>
<para>
<refsect1>
Some of the switches explained here can be passed to the backend
<title>See also</title>
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>
<para>
The optional argument <replaceable class="parameter">dbname</replaceable>
<xref linkend="app-initdb" endterm="app-initdb-title">,
specifies the name of the database to be accessed.
<xref linkend="app-ipcclean" endterm="app-ipcclean-title">,
<replaceable class="parameter">dbname</replaceable>
<xref linkend="app-postmaster" endterm="app-postmaster-title">
defaults to the value of the
<envar>USER</envar> environment variable.
</para>
</para>
</refsect1>
</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="app-postmaster" endterm="app-postmaster-title">.
</para>
</refsect1>
</refentry>
</refentry>
<!-- Keep this comment at the end of the file
<!-- Keep this comment at the end of the file
...
...
doc/src/sgml/ref/postmaster.sgml
View file @
8a9315ca
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.1
4 2000/11/13 23:57:20 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/postmaster.sgml,v 1.1
5 2000/11/14 18:11:31 petere
Exp $
Postgres documentation
Postgres documentation
-->
-->
<refentry id="APP-POSTMASTER">
<refentry id="APP-POSTMASTER">
<docinfo>
<date>2000-11-12</date>
</docinfo>
<refmeta>
<refmeta>
<refentrytitle id="APP-POSTMASTER-TITLE">
<refentrytitle id="APP-POSTMASTER-TITLE"><application>postmaster</application></refentrytitle>
<application>postmaster</application>
<manvolnum>1</manvolnum>
</refentrytitle>
<refmiscinfo>Application</refmiscinfo>
<refmiscinfo>Application</refmiscinfo>
</refmeta>
</refmeta>
<refnamediv>
<refnamediv>
<refname id="postmaster-ref">
<refname id="postmaster-ref">postmaster</refname>
<application>postmaster</application>
<refpurpose><productname>PostgreSQL</productname> multi-user database server</refpurpose>
</refname>
<refpurpose>
Run the <productname>Postgres</productname> multi-user backend
</refpurpose>
</refnamediv>
</refnamediv>
<refsynopsisdiv>
<refsynopsisdiv>
<refsynopsisdivinfo>
<cmdsynopsis>
<date>1999-07-20</date>
<command>postmaster</command>
</refsynopsisdivinfo>
<arg>-A <group choice="plain"><arg>0</arg><arg>1</arg></group></arg>
<synopsis>
<arg>-B <replaceable>nbuffers</replaceable></arg>
postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <replaceable class="parameter">DataDir</replaceable> ] [ -N <replaceable class="parameter">maxBackends</replaceable> ] [ -S ]
<arg>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
[ -d <replaceable class="parameter">DebugLevel</replaceable> ]
<arg>-d <replaceable>debug-level</replaceable></arg>
[ -h <replaceable class="parameter">hostname</replaceable> ] [ -i ]
<arg>-D <replaceable>datadir</replaceable></arg>
[ -k <replaceable class="parameter">path</replaceable> ] [ -l ]
<arg>-F</arg>
[ -o <replaceable class="parameter">BackendOptions</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ] [ -n | -s ]
<arg>-h <replaceable>hostname</replaceable></arg>
</synopsis>
<arg>-i</arg>
<arg>-k <replaceable>filename</replaceable></arg>
<refsect2 id="R2-APP-POSTMASTER-1">
<arg>-l</arg>
<refsect2info>
<arg>-N <replaceable>max-connections</replaceable></arg>
<date>1999-05-19</date>
<arg>-o <replaceable>extra-options</replaceable></arg>
</refsect2info>
<arg>-p <replaceable>port</replaceable></arg>
<title>
<arg>-S</arg>
Inputs
<group><arg>-n</arg><arg>-s</arg></group>
</title>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<application>postmaster</application> is the
<productname>PostgreSQL</productname> multi-user database server.
In order for a client application to access a database it connects
(over a network or locally) to a running
<application>postmaster</application>. The
<application>postmaster</application> then starts a separate server
process (<quote><xref linkend="app-postgres"
endterm="app-postgres-title"></quote>) to handle the connection.
The postmaster also manages the communication among server
processes.
</para>
<para>
By default the postmaster starts in the foreground and prints log
messages to the standard output. In practical applications the
postmaster should be started as a background process, perhaps at
boot time.
</para>
<para>
One postmaster always manages the data from exactly one database
cluster. A database cluster is a collection of databases that is
stored at a common file system location. When the postmaster
starts it needs to know the location of the database cluster files
(<quote>data area</quote>). This is done with the
<option>-D</option> invocation option or the <envar>PGDATA</envar>
environment variable, there is no default. More than one
postmaster process can run on a system at one time, as long as they
use different data areas and different port numbers (see below). A
data area is created with <xref linkend="app-initdb"
endterm="app-initdb-title">.
</para>
<refsect2 id="app-postmaster-options">
<title>Options</title>
<para>
<para>
<application>postmaster</application> accepts the following command line arguments:
<application>postmaster</application> accepts the following
command line arguments. For a detailed discussion of the options
consult the <citetitle>Administrator's Guide</citetitle>. You can
also save typing most of these options by setting up a
configuration file.
<variablelist>
<variablelist>
<varlistentry>
<varlistentry>
<term>-
B <replaceable class="parameter">nBuffers</replaceable>
</term>
<term>-
A 0|1
</term>
<listitem>
<listitem>
<para>
<para>
Sets the number of shared-memory disk buffers for the
Enables run-time assert checks, which is a debugging aid to
<application>postmaster</application>
detect programming mistakes. This is only available if it was
to allocate for use by the backend server processes that it
enabled during compilation. If so, the default is on.
starts. This value defaults to 64 buffers, where each buffer is 8k bytes
(or whatever BLCKSZ is set to in src/include/config.h).
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
D <replaceable class="parameter">DataDir
</replaceable></term>
<term>-
B <replaceable class="parameter">nbuffers
</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Specifies the directory to use as the root of the tree of database
Sets the number of shared buffers for use by the server
directories. If -D is not given, the default data directory name is
processes. This value defaults to 64 buffers, where each
the value of the environment variable
buffer is 8 kB.
<envar>PGDATA</envar>.
If <envar>PGDATA</envar> is not set, then the directory used is
<filename>$POSTGRESHOME/data</filename>.
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.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
N <replaceable class="parameter">maxBackends
</replaceable></term>
<term>-
c <replaceable>name</replaceable>=<replaceable>value
</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Sets the maximum number of backend server processes that this postmaster
Sets a named run-time parameter. Consult the
is allowed to start. By default, this value is 32, but it can be set
<citetitle>Administrator's Guide</citetitle> for a list and
as high as 1024 if your system will support that many processes.
descriptions. Most of the other command line options are in
(Note that -B is required to be at least twice -N, so you'll need to
fact short forms of such a parameter assignment.
increase -B if you increase -N.)
</para>
Both the default and upper limit values for -N can be altered
when building <productname>Postgres</productname>
<para>
(see src/include/config.h).
On some systems it is also possible to equivalently use
GNU-style long options in the form
<literal>--name=value</literal>.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
S
</term>
<term>-
d <replaceable>debug-level</replaceable>
</term>
<listitem>
<listitem>
<para>
<para>
Specifies that the <application>postmaster</application>
Sets the debug level. The higher this value is set, the more
process should start up in silent mode. That is, it will disassociate
debugging output is written to the server log. The default is
from the user's (controlling) tty, start its own process group, and
0, which means no debugging. Values up to 4 make sense.
redirect its standard output and standard error to
<filename>/dev/null</filename>.
</para>
<para>
<emphasis>Note</emphasis> 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.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
d <replaceable class="parameter">DebugLevel
</replaceable></term>
<term>-
D <replaceable class="parameter">datadir
</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Determines the amount of debugging output the backend servers will
Specifies the file system location of the data directory. See
produce.
discussion above.
If <replaceable class="parameter">DebugLevel</replaceable>
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 <application>postmaster</application>.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
h <replaceable class="parameter">hostName</replaceable>
</term>
<term>-
F
</term>
<listitem>
<listitem>
<para>
<para>
Specifies the TCP/IP hostname or address
Disables <function>fsync</function> calls for performance
on which the <application>postmaster</application>
improvement at the risk of data corruption. Read the detailed
is to listen for connections from frontend applications. Defaults to
documentation before using this!
the value of the <envar>PGHOST</envar>
environment variable, or if <envar>PGHOST</envar>
is not set, it defaults to listening on all configured addresses
(including localhost).
</para>
<para>
If you use a hostname do not try to run
multiple instances of <application>postmaster</application> 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 <application>postmaster</application> instances are
listening must be distinct in the two last octets.
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-h <replaceable class="parameter">hostname</replaceable></term>
<listitem>
<para>
<para>
If you don't use this option, each instance must listen on a
Specifies the TCP/IP hostname or address on which the
different port (via -p or <envar>PGPORT</envar>). And, of course, do
<application>postmaster</application> is to listen for
not try to use both approaches on one host.
connections from client applications. Defaults to the value
of the <envar>PGHOST</envar> environment variable, or if
<envar>PGHOST</envar> is not set, it defaults to listening on
all configured addresses (including localhost).
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -158,65 +177,63 @@ postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <re
...
@@ -158,65 +177,63 @@ postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <re
<term>-i</term>
<term>-i</term>
<listitem>
<listitem>
<para>
<para>
Allows clients to connect via TCP/IP (Internet domain)
connections.
Allows clients to connect via TCP/IP (Internet domain)
Without this option, only local Unix domain socket connections are
connections. Without this option, only local Unix domain
accepted.
socket connections are
accepted.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-k <replaceable class="parameter">
path
</replaceable></term>
<term>-k <replaceable class="parameter">
filename
</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Specifies the local Unix domain socket path name
Specifies the Unix domain socket file name on which the
on which the <application>postmaster</application>
<application>postmaster</application> is to listen for
is to listen for connections from frontend applications. Defaults to
connections from client applications. Defaults to the value
the value of the
of the <envar>PGUNIXSOCKET</envar> environment variable, or if
<envar>PGUNIXSOCKET</envar>
<envar>PGUNIXSOCKET</envar> is not set, then defaults to a
environment variable, or if <envar>PGUNIXSOCKET</envar>
file in <filename>/tmp</filename> constructed from the port
is not set, then defaults to a file in <filename>/tmp</filename>
number.
constructed from the port number.
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-l</term>
<listitem>
<para>
<para>
You can use this option to put the Unix-domain socket in a
Enables secure connections using SSL. The <option>-i</option>
directory that is private to one or more users using Unix
option is also required. You must have compiled with SSL
directory permissions. This is necessary for securely
enabled to use this option.
creating databases automatically on shared machines.
In that situation, also disallow all TCP/IP connections
initially in <filename>pg_hba.conf</filename>.
If you specify a socket path other than the
default then all frontend applications (including
<application>psql</application>) must specify the same
socket path using either command-line options or
<envar>PGUNIXSOCKET</envar>.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
l
</term>
<term>-
N <replaceable class="parameter">max-connections</replaceable>
</term>
<listitem>
<listitem>
<para>
<para>
Enables secure connections using SSL. The <option>-i</option> option
Sets the maximum number of client connections that this
is also required.
postmaster will accept. By default, this value is 32, but it
You must have compiled with SSL enabled to use this option.
can be set as high as 1024 if your system will support that
many processes. (Note that <option>-B</option> is required to
be at least twice <option>-N</option>.)
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-o <replaceable class="parameter">
BackendO
ptions</replaceable></term>
<term>-o <replaceable class="parameter">
extra-o
ptions</replaceable></term>
<listitem>
<listitem>
<para>
<para>
The
The command line-style options specified in <replaceable
<literal>postgres</literal>
class="parameter">EXTRA-OPTIONS</replaceable> are passed to
option(s) specified in
all backend server processes started by this
<replaceable class="parameter">BackendOptions</replaceable>
<application>postmaster</application>. See <xref
are passed to all backend server processes started by this
linkend="app-postgres" endterm="app-postgres-title"> for
<application>postmaster</application>.
possibilities. If the option string contains any spaces, the
If the option string contains any spaces, the entire string must be
entire string must be quoted.
quoted.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -225,38 +242,54 @@ postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <re
...
@@ -225,38 +242,54 @@ postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <re
<term>-p <replaceable class="parameter">port</replaceable></term>
<term>-p <replaceable class="parameter">port</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Specifies the TCP/IP port or local Unix domain socket file extension
Specifies the TCP/IP port or local Unix domain socket file
on which the <application>postmaster</application>
extension on which the <application>postmaster</application>
is to listen for connections from frontend applications. Defaults to
is to listen for connections from client applications.
the value of the
Defaults to the value of the <envar>PGPORT</envar> environment
<envar>PGPORT</envar>
variable, or if <envar>PGPORT</envar> is not set, then
environment variable, or if <envar>PGPORT</envar>
defaults to the value established during compilation (normally
is not set, then defaults to the value established when Postgres was
5432). If you specify a port other than the default port,
compiled (normally 5432). If you specify a port other than the
then all client applications must specify the same port using
default port, then all frontend applications (including
either command-line options or <envar>PGPORT</envar>.
<application>psql</application>) must specify the same
port using either command-line options or
<envar>PGPORT</envar>.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<term>-S</term>
<listitem>
<para>
Specifies that the <application>postmaster</application>
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 <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
the postmaster in the background.
</para>
</listitem>
</varlistentry>
</variablelist>
</variablelist>
</para>
</para>
<para>
<para>
Two additional command line options are available for debugging problems
Two additional command line options are available for debugging
that cause a backend to die abnormally.
problems that cause a backend to die abnormally. These options
These options control the behavior of the
control the behavior of the <application>postmaster</application>
<application>postmaster</application> in this situation, and
in this situation, and <emphasis>neither option is intended for
<emphasis>neither option is intended for use in
use in ordinary operation</emphasis>.
ordinary operation</emphasis>.
</para>
</para>
<para>
<para>
The ordinary strategy for this situation is to notify all other
The ordinary strategy for this situation is to notify all other
backends that they must terminate and then reinitialize the shared
backends that they must terminate and then reinitialize the shared
memory and semaphores. This is because an errant backend could
have
memory and semaphores. This is because an errant backend could
corrupted some shared state before terminating.
have
corrupted some shared state before terminating.
</para>
</para>
<para>
<para>
...
@@ -292,31 +325,12 @@ postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <re
...
@@ -292,31 +325,12 @@ postmaster [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -D <re
</refsect2>
</refsect2>
<refsect2 id="R2-APP-POSTMASTER-2">
<refsect2 id="R2-APP-POSTMASTER-2">
<refsect2info>
<date>1999-05-19</date>
</refsect2info>
<title>
<title>
Outputs
Outputs
</title>
</title>
<para>
<para>
<variablelist>
<variablelist>
<!--
<varlistentry>
<term>
FindBackend: could not find a backend to execute...
</term>
<listitem>
<para>
If you see this message, you do not have the
<application>postgres</application>
executable in your path. Add the directory in which
<application>postgres</application> resides to
your path.
</para>
</listitem>
</varlistentry>
-->
<varlistentry>
<varlistentry>
<term><computeroutput>
<term><computeroutput>
semget: No space left on device
semget: No space left on device
...
@@ -416,124 +430,65 @@ IpcMemoryAttach: shmat() failed: Permission denied
...
@@ -416,124 +430,65 @@ IpcMemoryAttach: shmat() failed: Permission denied
</variablelist>
</variablelist>
</para>
</para>
</refsect2>
</refsect2>
</refsynopsisdiv>
</refsect1>
<refsect1 id="R1-APP-POSTMASTER-1">
<refsect1info>
<date>1999-05-19</date>
</refsect1info>
<title>
Description
</title>
<para>
<application>postmaster</application>
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).
<application>postmaster</application>
does not itself interact with the user and should be started as a
background process.
</para>
<refsect1>
<title>Notes</title>
<para>
<para>
<emphasis>Only one postmaster should be running at a time in a given
If at all possible, <emphasis>do not</emphasis> use
<productname>Postgres</productname> installation.</emphasis>
<literal>SIGKILL</literal> to kill the
Here, an installation means a database directory and
<application>postmaster</application>. This will prevent
<application>postmaster</application>
port number.
<application>postmaster</application>
from freeing the system
You can run more than one postmaster on a machine only if each one has a
resources (e.g., shared memory and semaphores) that it holds before
separate directory and port number
.
terminating
.
</para>
</para>
</refsect1>
<refsect1 id="R1-APP-POSTMASTER-2">
<refsect1info>
<date>1998-10-04</date>
</refsect1info>
<title>
Notes
</title>
<para>
<para>
If at all possible,
To terminate the postmaster normally, the signals
<emphasis>do not</emphasis>
<literal>SIGTERM</literal>, <literal>SIGINT</literal>, or
use <literal>SIGKILL</literal>
<literal>SIGQUIT</literal> can be used. The first will wait for
when killing the <application>postmaster</application>.
all clients to terminate before quitting, the second will
<literal>SIGHUP</literal>,
forcefully disconnect all clients, and the third will quit
<literal>SIGINT</literal>,
immediately without lengthy shutdown, resulting in a recovery run
or
during restart.
<literal>SIGTERM</literal>
(the default signal for
<application>kill</application>(1))"
should be used instead. Using
<programlisting>
$ kill -KILL
</programlisting>
or its alternative form
<programlisting>
$ kill -9
</programlisting>
will prevent <application>postmaster</application>
from freeing the system resources (e.g., shared memory and semaphores)
that it holds before dying. Use <literal>SIGTERM</literal> instead
to avoid having to clean up manually (as described earlier).
</para>
</para>
<para>
<para>
Useful utilities for dealing with shared memory problems include
The utility command <xref linkend="app-pg-ctl"> can be used to
<application>ipcs(1)</application>,
start and shut down the postmaster safely and comfortably.
<application>ipcrm(1</application>), and
<application>ipcclean(1)</application>.
</para>
</para>
</refsect1>
</refsect1>
<refsect1 id="R1-APP-POSTMASTER-3">
<refsect1info>
<date>1998-10-04</date>
</refsect1info>
<title>
Usage
</title>
<para>
To start <application>postmaster</application> using default
values, type:
<programlisting>
<refsect1 id="app-postmaster-usage">
$ nohup postmaster >logfile 2>&1 &
<title>Usage</title>
</programlisting>
<para>
To start <application>postmaster</application> in the background
using default values, type:
This command will start up <application>postmaster</application>
<screen>
on the default port (5432). This is the
<prompt>$</prompt> <userinput>nohup postmaster >logfile 2>&1 </dev/null &</userinput>
simplest and most common way to start the
</screen>
<application>postmaster</application>.
</para>
</para>
<para>
<para>
To start <application>postmaster</application> with a specific port:
To start <application>postmaster</application> with a specific
port:
<programlisting>
<screen>
$ nohup postmaster -p 1234 &
<prompt>$</prompt> <userinput>postmaster -p 1234</userinput>
</programlisting>
</screen>
This command will start up <application>postmaster</application>
This command will start up <application>postmaster</application>
communicating through the port 1234. In order to
communicating through the port 1234. In order to connect to this
connect to this <application>postmaster</application>
<application>postmaster</application> using psql, you would need to
using psql, you would need to run it as
run it as
<screen>
<programlisting>
<prompt>$</prompt> <userinput>psql -p 1234</userinput>
$ psql -p 1234
</screen>
</programlisting>
or set the environment variable <envar>PGPORT</envar>:
or set the environment variable <envar>PGPORT</envar>:
<screen>
<programlisting>
<prompt>$</prompt> <userinput>export PGPORT=1234</userinput>
$ export PGPORT 1234
<prompt>$</prompt> <userinput>psql</userinput>
$ psql
</screen>
</programlisting>
</para>
</para>
</refsect1>
</refsect1>
</refentry>
</refentry>
...
...
doc/src/sgml/runtime.sgml
View file @
8a9315ca
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.3
4 2000/11/13 21:35:02 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.3
5 2000/11/14 18:11:30 petere
Exp $
-->
-->
<Chapter Id="runtime">
<Chapter Id="runtime">
...
@@ -930,7 +930,34 @@ env PGOPTIONS='-c geqo=off' psql
...
@@ -930,7 +930,34 @@ env PGOPTIONS='-c geqo=off' psql
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>KRB_SERVER_KEYFILE</>
<term>HOSTNAME (<type>string</type>)</term>
<listitem>
<para>
Specifies the TCP/IP hostname or address on which the
<application>postmaster</application> is to listen for
connections from client applications. Defaults to the value
of the <envar>PGHOST</envar> environment variable, or if
<envar>PGHOST</envar> is not set, it defaults to listening on
all configured addresses (including localhost).
</para>
<para>
If you use a hostname do not try to run multiple instances of
<application>postmaster</application> 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
<application>postmaster</application> instances are listening
must be distinct in the two last octets.
</para>
<para>
If you do not use this option, then each instance must listen
on a different port.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>KRB_SERVER_KEYFILE (<type>string</type>)</term>
<listitem>
<listitem>
<para>
<para>
Sets the location of the Kerberos server key file. See
Sets the location of the Kerberos server key file. See
...
@@ -1056,6 +1083,21 @@ env PGOPTIONS='-c geqo=off' psql
...
@@ -1056,6 +1083,21 @@ env PGOPTIONS='-c geqo=off' psql
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<term>UNIXSOCKET (<type>string</type>)</term>
<listitem>
<para>
Specifies the Unix domain socket file name on which the
<application>postmaster</application> is to listen for
connections from client applications. Defaults to the value
of the <envar>PGUNIXSOCKET</envar> environment variable, or if
<envar>PGUNIXSOCKET</envar> is not set, then defaults to a
file in <filename>/tmp</filename> constructed from the port
number.
</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term>UNIX_SOCKET_GROUP (<type>string</type>)</term>
<term>UNIX_SOCKET_GROUP (<type>string</type>)</term>
<listitem>
<listitem>
...
...
src/backend/postmaster/postmaster.c
View file @
8a9315ca
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.18
5 2000/11/14 01:15:01 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.18
6 2000/11/14 18:11:31 petere
Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -790,30 +790,30 @@ static void
...
@@ -790,30 +790,30 @@ static void
usage
(
const
char
*
progname
)
usage
(
const
char
*
progname
)
{
{
printf
(
"%s is the PostgreSQL server.
\n\n
"
,
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
"
);
printf
(
"Options:
\n
"
);
#ifdef USE_ASSERT_CHECKING
#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
#endif
printf
(
" -B
<buffers> number of shared buffers
\n
"
);
printf
(
" -B
NBUFFERS number of shared buffers (default %d)
\n
"
,
DEF_NBUFFERS
);
printf
(
" -c
<name>=<value>
set run-time parameter
\n
"
);
printf
(
" -c
NAME=VALUE
set run-time parameter
\n
"
);
printf
(
" -d 1-5 debugging level
\n
"
);
printf
(
" -d 1-5 debugging level
\n
"
);
printf
(
" -D
<directory>
database directory
\n
"
);
printf
(
" -D
DATADIR
database directory
\n
"
);
printf
(
" -F turn fsync off
\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
(
" -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
#ifdef USE_SSL
printf
(
" -l enable SSL connections
\n
"
);
printf
(
" -l enable SSL connections
\n
"
);
#endif
#endif
printf
(
" -N
<number>
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
);
MAXBACKENDS
,
DEF_MAXBACKENDS
);
printf
(
" -o
<option> pass 'option
' to each backend server
\n
"
);
printf
(
" -o
OPTIONS pass 'OPTIONS
' to each backend server
\n
"
);
printf
(
" -p
<port> port number to listen on
\n
"
);
printf
(
" -p
PORT port number to listen on (default %d)
\n
"
,
DEF_PGPORT
);
printf
(
" -S silent mode (
dissociate from tty
)
\n
"
);
printf
(
" -S silent mode (
start in background without logging output
)
\n
"
);
printf
(
"
\n
Developer options:
\n
"
);
printf
(
"
\n
Developer options:
\n
"
);
printf
(
" -n do
n'
t reinitialize shared memory after abnormal exit
\n
"
);
printf
(
" -n do
no
t reinitialize shared memory after abnormal exit
\n
"
);
printf
(
" -s send SIGSTOP to all backend servers if one dies
\n
"
);
printf
(
" -s send SIGSTOP to all backend servers if one dies
\n
"
);
printf
(
"
\n
Please read the documentation for the complete list of run-time
\n
"
printf
(
"
\n
Please read the documentation for the complete list of run-time
\n
"
...
...
src/backend/tcop/postgres.c
View file @
8a9315ca
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.18
7 2000/11/08 17:57:46
petere Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.18
8 2000/11/14 18:11:32
petere Exp $
*
*
* NOTES
* NOTES
* this is the "main" module of the postgres backend and
* this is the "main" module of the postgres backend and
...
@@ -1001,38 +1001,41 @@ SigHupHandler(SIGNAL_ARGS)
...
@@ -1001,38 +1001,41 @@ SigHupHandler(SIGNAL_ARGS)
}
}
static
void
static
void
usage
(
char
*
progname
)
usage
(
char
*
progname
)
{
{
fprintf
(
stderr
,
printf
(
"%s is the PostgreSQL stand-alone backend. It is not
\n
intended to be used by normal users.
\n\n
"
,
progname
);
"Usage: %s [options] [dbname]
\n
"
,
progname
);
printf
(
"Usage:
\n
%s [options...] [dbname]
\n\n
"
,
progname
);
printf
(
"Options:
\n
"
);
#ifdef USE_ASSERT_CHECKING
#ifdef USE_ASSERT_CHECKING
fprintf
(
stderr
,
"
\t
-A on
\t\t
enable/disabl
e assert checking
\n
"
);
printf
(
" -A 1|0 enable/disable run-tim
e assert checking
\n
"
);
#endif
#endif
fprintf
(
stderr
,
"
\t
-B buffers
\t
set number of buffers in buffer pool
\n
"
);
printf
(
" -B NBUFFERS number of shared buffers (default %d)
\n
"
,
DEF_NBUFFERS
);
fprintf
(
stderr
,
"
\t
-c name=value
\t
set run-time parameter
\n
"
);
printf
(
" -c NAME=VALUE set run-time parameter
\n
"
);
fprintf
(
stderr
,
"
\t
-C
\t\t
suppress version info
\n
"
);
printf
(
" -d 1-5 debugging level
\n
"
);
fprintf
(
stderr
,
"
\t
-D dir
\t\t
data directory
\n
"
);
printf
(
" -D DATADIR database directory
\n
"
);
fprintf
(
stderr
,
"
\t
-E
\t\t
echo query before execution
\n
"
);
printf
(
" -e use European date format
\n
"
);
fprintf
(
stderr
,
"
\t
-F
\t\t
turn fsync off
\n
"
);
printf
(
" -E echo query before execution
\n
"
);
fprintf
(
stderr
,
"
\t
-L
\t\t
turn off locking
\n
"
);
printf
(
" -F turn fsync off
\n
"
);
fprintf
(
stderr
,
"
\t
-N
\t\t
don't use newline as interactive query delimiter
\n
"
);
printf
(
" -N do not use newline as interactive query delimiter
\n
"
);
fprintf
(
stderr
,
"
\t
-O
\t\t
allow system table structure changes
\n
"
);
printf
(
" -o FILENAME send stdout and stderr to given file
\n
"
);
fprintf
(
stderr
,
"
\t
-Q
\t\t
suppress informational messages
\n
"
);
printf
(
" -P disable system indexes
\n
"
);
fprintf
(
stderr
,
"
\t
-S kbytes
\t
set amount of memory for sorts (in kbytes)
\n
"
);
printf
(
" -s show statistics after each query
\n
"
);
fprintf
(
stderr
,
"
\t
-T options
\t
specify pg_options
\n
"
);
printf
(
" -S SORT-MEM set amount of memory for sorts (in kbytes)
\n
"
);
fprintf
(
stderr
,
"
\t
-W sec
\t\t
wait N seconds to allow attach from a debugger
\n
"
);
printf
(
"Developer options:
\n
"
);
fprintf
(
stderr
,
"
\t
-d [1-5]
\t
set debug level
\n
"
);
printf
(
" -f [s|i|n|m|h] forbid use of some plan types
\n
"
);
fprintf
(
stderr
,
"
\t
-e
\t\t
turn on European date format
\n
"
);
printf
(
" -i do not execute queries
\n
"
);
fprintf
(
stderr
,
"
\t
-f [s|i|n|m|h]
\t
forbid use of some plan types
\n
"
);
printf
(
" -L turn off locking
\n
"
);
fprintf
(
stderr
,
"
\t
-i
\t\t
don't execute queries
\n
"
);
printf
(
" -O allow system table structure changes
\n
"
);
fprintf
(
stderr
,
"
\t
-o file
\t\t
send stdout and stderr to given filename
\n
"
);
printf
(
" -t [pa|pl|ex] show timings after each query
\n
"
);
fprintf
(
stderr
,
"
\t
-p database
\t
backend is started under a postmaster
\n
"
);
printf
(
" -W NUM wait NUM seconds to allow attach from a debugger
\n
"
);
fprintf
(
stderr
,
"
\t
-s
\t\t
show stats after each query
\n
"
);
printf
(
"
\n
Report bugs to <pgsql-bugs@postgresql.org>.
\n
"
);
fprintf
(
stderr
,
"
\t
-t [pa|pl|ex]
\t
show timings after each query
\n
"
);
fprintf
(
stderr
,
"
\t
-v version
\t
set protocol version being used by frontend
\n
"
);
}
}
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* PostgresMain
* PostgresMain
* postgres main loop -- all backends, interactive or otherwise start here
* postgres main loop -- all backends, interactive or otherwise start here
...
@@ -1646,7 +1649,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
...
@@ -1646,7 +1649,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha
if
(
!
IsUnderPostmaster
)
if
(
!
IsUnderPostmaster
)
{
{
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"
\n
POSTGRES backend interactive interface "
);
puts
(
"$Revision: 1.18
7 $ $Date: 2000/11/08 17:57:46
$
\n
"
);
puts
(
"$Revision: 1.18
8 $ $Date: 2000/11/14 18:11:32
$
\n
"
);
}
}
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment