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
Show 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>
<refsynopsisdivinfo>
<date>1999-07-20</date>
</refsynopsisdivinfo>
<synopsis>
postgres [ <replaceable class="parameter">dbname</replaceable> ]
postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -D <replaceable class="parameter">DataDir</replaceable> ] [ -E ] [ -F ]
[ -O ] [ -P ] [ -Q ] [ -S <replaceable class="parameter">SortSize</replaceable> ] [ -d [ <replaceable class="parameter">DebugLevel</replaceable> ] ] [ -e ]
[ -o ] [ <replaceable class="parameter">OutputFile</replaceable> ] [ -s ] [ -v <replaceable class="parameter">protocol</replaceable> ] [ <replaceable class="parameter">dbname</replaceable> ]
</synopsis>
<refsect2 id="R2-APP-POSTGRES-1">
<refsect2info>
<date>1999-05-19</date>
</refsect2info>
<title>
Inputs
</title>
<para>
<application>postgres</application> accepts the following command line arguments:
<variablelist>
<varlistentry>
<term><replaceable class="parameter">dbname</replaceable></term>
<listitem>
<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>
</listitem>
</varlistentry>
<varlistentry>
<refsynopsisdiv>
<term>-B <replaceable class="parameter">nBuffers</replaceable></term>
<cmdsynopsis>
<listitem>
<!-- standalone call -->
<para>
<command>postgres</command>
If the backend is running under the
<arg>-A <group choice="plain"><arg>0</arg><arg>1</arg></group></arg>
<application>postmaster</application>,
<arg>-B <replaceable>nbuffers</replaceable></arg>
<replaceable class="parameter">nBuffers</replaceable>
<arg>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
is the number of shared-memory buffers that the
<arg>-d <replaceable>debug-level</replaceable></arg>
<application>postmaster</application>
<arg>-D <replaceable>datadir</replaceable></arg>
has allocated for the backend server processes that it starts. If the
<arg>-e</arg>
backend is running stand-alone, this specifies the number of buffers to
<arg>-E</arg>
allocate. This value defaults to 64 buffers, where each buffer is 8k bytes
<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>
(or whatever BLCKSZ is set to in config.h).
<arg>-F</arg>
</para>
<arg>-i</arg>
</listitem>
<arg>-L</arg>
</varlistentry>
<arg>-N</arg>
<arg>-o <replaceable>file-name</replaceable></arg>
<arg>-O</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>-W <replaceable>seconds</replaceable></arg>
<arg choice="plain"><replaceable>database</replaceable></arg>
<sbr>
<!-- postmaster fork -->
<command>postgres</command>
<arg>-A <group choice="plain"><arg>0</arg><arg>1</arg></group></arg>
<arg>-B <replaceable>nbuffers</replaceable></arg>
<arg>-c <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
<arg>-d <replaceable>debug-level</replaceable></arg>
<arg>-D <replaceable>datadir</replaceable></arg>
<arg>-e</arg>
<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>-C</term>
<title>Description</title>
<listitem>
<para>
Do not show the server version number.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-D <replaceable class="parameter">DataDir</replaceable></term>
<listitem>
<para>
<para>
Specifies the directory to use as the root of the tree of database
The <filename>postgres</filename> executable is the actual
directories. If -D is not given, the default data directory name is
<productname>PostgreSQL</productname> server process that processes
the value of the environment variable
queries. The second form above is how
<envar>PGDATA</envar>.
<application>postgres</application> is invoked by the <xref
If <envar>PGDATA</envar> is not set, then the directory used is
linkend="app-postmaster" endterm="app-postmaster-title"> (only
<filename>$POSTGRESHOME/data</filename>.
conceptually, since both <filename>postmaster</filename> and
If neither environment variable is set and this command-line
<filename>postgres</filename> are in fact the same program); it
option is not specified, the default directory that was
should not be invoked directly this way. The first form invokes
set at compile-time is used.
the server directly in interactive mode. The primary use for this
mode is for bootstrapping by <xref linkend="app-initdb"
endterm="app-initdb-title">.
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-E</term>
<listitem>
<para>
<para>
Echo all queries.
When invoked in interactive mode from the shell, the user can enter
queries and the results will be printed to the screen, but in a
form that is more useful for developers than end users. But note
that running a single-user backend is not truly suitable for
debugging the server since no realistic inter-process communication
and locking will happen.
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-F</term>
<listitem>
<para>
<para>
Disable an automatic <function>fsync()</function> call after each transaction.
When running a stand-alone backend the session user name will
This option improves performance, but an operating system crash
automatically be set to the current effective Unix user name. If
while a transaction is in progress may cause the loss of
that user does not exist the server will not start.
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>
</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>
<term>-P</term>
<listitem>
<para>
<para>
Ignore system indexes to scan/update system
When <application>postgres</application> is started by a <xref
tuples. The <command>REINDEX</command> for system tables/indexes
linkend="app-postmaster" endterm="app-postmaster-title"> then it
requires this option. System tables are
inherits all options set by the latter. Additionally,
typically those with a leading <literal>pg_</literal> in the
<application>postgres</application>-specific options can be passed
table name.
from the <application>postmaster</application> with the
<option>-o</option> switch.
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-Q</term>
<listitem>
<para>
<para>
Specifies "quiet" mode.
You can avoid having to type these options by setting up a
configuration file. See the <citetitle>Administrator's
Guide</citetitle> for details. Some (safe) options can also be
set from the connecting client in an application-dependent way.
For example, if the environment variable <envar>PGOPTIONS</envar>
is set, then libpq-based clients will pass that string to the
server, which will interpret it as
<application>postgres</application> command-line options.
</para>
</para>
</listitem>
</varlistentry>
<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>
<term>-d [ <replaceable class="parameter">DebugLevel</replaceable> ]</term>
<listitem>
<para>
<para>
The optional argument <replaceable class="parameter">DebugLevel</replaceable>
The options <option>-A</option>, <option>-B</option>,
determines the amount of debugging output the backend servers will
<option>-c</option>, <option>-d</option>, <option>-D</option>,
produce.
and <option>-F</option> have the same meaning as with the <xref
If <replaceable class="parameter">DebugLevel</replaceable>
linkend="app-postmaster" endterm="app-postmaster-title">.
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>
</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">
<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>
<varlistentry>
<term><computeroutput>
<term>-p <replaceable class="parameter">database</replaceable></term>
semget: No space left on device
</computeroutput></term>
<listitem>
<listitem>
<para>
<para>
If you see this message, you should run the
Indicates that this server has been started by a
<application>ipcclean</application>
<application>postmaster</application> and makes different
command. After doing this, try starting
assumptions about buffer pool management, file descriptors,
<application>postmaster</application>
etc.
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>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</para>
</refsect2>
</refsynopsisdiv>
<refsect1 id="R1-APP-POSTGRES-1">
<refsect1info>
<date>1999-05-19</date>
</refsect1info>
<title>
Description
</title>
<varlistentry>
<term>-t pa[rser] | pl[anner] | e[xecutor]</term>
<listitem>
<para>
<para>
The Postgres backend server can be executed directly from the user shell.
Print timing statistics for each query relating to each of the
This should be done only while debugging by the DBA, and should not be
major system modules. This option cannot be used together
done while other Postgres backends are being managed by a
with the <option>-s</option> option.
<application>postmaster</application>
on this set of databases.
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-v <replaceable class="parameter">protocol</replaceable></term>
<listitem>
<para>
<para>
Some of the switches explained here can be passed to the backend
Specifies the version number of the frontend/backend protocol
through the "database options" field of a connection request, and thus can be
to be used for this particular session.
set for a particular backend without going to the trouble of restarting the
postmaster. This is particularly handy for debugging-related switches.
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-W <replaceable class="parameter">seconds</replaceable></term>
<listitem>
<para>
<para>
The optional argument <replaceable class="parameter">dbname</replaceable>
As soon as this option is encountered, the process sleeps for
specifies the name of the database to be accessed.
the specified amount of seconds. This gives developers time
<replaceable class="parameter">dbname</replaceable>
to attach a debugger to the backend process.
defaults to the value of the
<envar>USER</envar> environment variable.
</para>
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect3>
</refsect2>
</refsect1>
</refsect1>
<refsect1 id="R1-APP-POSTGRES-2">
<refsect1>
<refsect1info>
<title>See also</title>
<date>1998-10-04</date>
</refsect1info>
<title>
Notes
</title>
<para>
<para>
Useful utilities for dealing with shared memory problems include
<xref linkend="app-initdb" endterm="app-initdb-title">,
<application>ipcs(1)</application>,
<xref linkend="app-ipcclean" endterm="app-ipcclean-title">,
<application>ipcrm(1</application>), and
<xref linkend="app-postmaster" endterm="app-postmaster-title">
<application>ipcclean(1)</application>.
See also <xref linkend="app-postmaster" endterm="app-postmaster-title">.
</para>
</para>
</refsect1>
</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>
</listitem>
</varlistentry>
<varlistentry>
<term>-D <replaceable class="parameter">datadir</replaceable></term>
<listitem>
<para>
<para>
<emphasis>Note</emphasis> that using this switch makes it very
Specifies the file system location of the data directory. See
difficult to troubleshoot problems, since all tracing and logging
discussion above.
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>-
F
</term>
<listitem>
<listitem>
<para>
<para>
Determines the amount of debugging output the backend servers will
Disables <function>fsync</function> calls for performance
produce.
improvement at the risk of data corruption. Read the detailed
If <replaceable class="parameter">DebugLevel</replaceable>
documentation before using this!
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">host
N
ame</replaceable></term>
<term>-h <replaceable class="parameter">host
n
ame</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Specifies the TCP/IP hostname or address
Specifies the TCP/IP hostname or address 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 <envar>PGHOST</envar>
of the <envar>PGHOST</envar> environment variable, or if
environment variable, or if <envar>PGHOST</envar>
<envar>PGHOST</envar> is not set, it defaults to listening on
is not set, it defaults to listening on all configured addresses
all configured addresses (including localhost).
(including localhost).
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>-i</term>
<listitem>
<para>
<para>
If you use a hostname do not try to run
Allows clients to connect via TCP/IP (Internet domain)
multiple instances of <application>postmaster</application> on the
connections. Without this option, only local Unix domain
same IP address but different ports. Doing so will result in them
socket connections are accepted.
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>-k <replaceable class="parameter">filename</replaceable></term>
<listitem>
<para>
<para>
If you don't use this option, each instance must listen on a
Specifies the Unix domain socket file name 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>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>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
i
</term>
<term>-
l
</term>
<listitem>
<listitem>
<para>
<para>
Allows clients to connect via TCP/IP (Internet domain) connections.
Enables secure connections using SSL. The <option>-i</option>
Without this option, only local Unix domain socket connections are
option is also required. You must have compiled with SSL
accepted
.
enabled to use this option
.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
k <replaceable class="parameter">path
</replaceable></term>
<term>-
N <replaceable class="parameter">max-connections
</replaceable></term>
<listitem>
<listitem>
<para>
<para>
Specifies the local Unix domain socket path name
Sets the maximum number of client connections that this
on which the <application>postmaster</application>
postmaster will accept. By default, this value is 32, but it
is to listen for connections from frontend applications. Defaults to
can be set as high as 1024 if your system will support that
the value of the
many processes. (Note that <option>-B</option> is required to
<envar>PGUNIXSOCKET</envar>
be at least twice <option>-N</option>.)
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>
<para>
You can use this option to put the Unix-domain socket in a
directory that is private to one or more users using Unix
directory permissions. This is necessary for securely
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>-
o <replaceable class="parameter">extra-options</replaceable>
</term>
<listitem>
<listitem>
<para>
<para>
Enables secure connections using SSL. The <option>-i</option> option
The command line-style options specified in <replaceable
is also required.
class="parameter">EXTRA-OPTIONS</replaceable> are passed to
You must have compiled with SSL enabled to use this option.
all backend server processes started by this
<application>postmaster</application>. See <xref
linkend="app-postgres" endterm="app-postgres-title"> for
possibilities. If the option string contains any spaces, the
entire string must be quoted.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
o <replaceable class="parameter">BackendOptions
</replaceable></term>
<term>-
p <replaceable class="parameter">port
</replaceable></term>
<listitem>
<listitem>
<para>
<para>
The
Specifies the TCP/IP port or local Unix domain socket file
<literal>postgres</literal>
extension on which the <application>postmaster</application>
option(s) specified in
is to listen for connections from client applications.
<replaceable class="parameter">BackendOptions</replaceable>
Defaults to the value of the <envar>PGPORT</envar> environment
are passed to all backend server processes started by this
variable, or if <envar>PGPORT</envar> is not set, then
<application>postmaster</application>.
defaults to the value established during compilation (normally
If the option string contains any spaces, the entire string must be
5432). If you specify a port other than the default port,
quoted.
then all client applications must specify the same port using
either command-line options or <envar>PGPORT</envar>.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<varlistentry>
<term>-
p <replaceable class="parameter">port</replaceable>
</term>
<term>-
S
</term>
<listitem>
<listitem>
<para>
<para>
Specifies the TCP/IP port or local Unix domain socket file extension
Specifies that the <application>postmaster</application>
on which the <application>postmaster</application>
process should start up in silent mode. That is, it will
is to listen for connections from frontend applications. Defaults to
disassociate from the user's (controlling) terminal, start its
the value of the
own process group, and redirect its standard output and
<envar>PGPORT</envar>
standard error to <filename>/dev/null</filename>.
environment variable, or if <envar>PGPORT</envar>
</para>
is not set, then defaults to the value established when Postgres was
<para>
compiled (normally 5432). If you specify a port other than the
Using this switch discards all logging output, which is
default port, then all frontend applications (including
probably not what you want, since it makes it very difficult
<application>psql</application>) must specify the same
to troubleshoot problems. See below for a better way to start
port using either command-line options or
the postmaster in the background.
<envar>PGPORT</envar>.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</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>
</refs
ynopsisdiv
>
</refs
ect1
>
<refsect1 id="R1-APP-POSTMASTER-1">
<refsect1>
<refsect1info>
<title>Notes</title>
<date>1999-05-19</date>
</refsect1info>
<title>
Description
</title>
<para>
<para>
<application>postmaster</application>
If at all possible, <emphasis>do not</emphasis> use
manages the communication between frontend and backend processes, as
<literal>SIGKILL</literal> to kill the
well as allocating the shared buffer pool and SysV semaphores
<application>postmaster</application>. This will prevent
(on machines without a test-and-set instruction).
<application>postmaster</application> from freeing the system
<application>postmaster</application>
resources (e.g., shared memory and semaphores) that it holds before
does not itself interact with the user and should be started as a
terminating.
background process.
</para>
</para>
<para>
<para>
<emphasis>Only one postmaster should be running at a time in a given
To terminate the postmaster normally, the signals
<productname>Postgres</productname> installation.</emphasis>
<literal>SIGTERM</literal>, <literal>SIGINT</literal>, or
Here, an installation means a database directory and
<literal>SIGQUIT</literal> can be used. The first will wait for
<application>postmaster</application> port number.
all clients to terminate before quitting, the second will
You can run more than one postmaster on a machine only if each one has a
forcefully disconnect all clients, and the third will quit
separate directory and port number.
immediately without lengthy shutdown, resulting in a recovery run
during restart.
</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,
The utility command <xref linkend="app-pg-ctl"> can be used to
<emphasis>do not</emphasis>
start and shut down the postmaster safely and comfortably.
use <literal>SIGKILL</literal>
when killing the <application>postmaster</application>.
<literal>SIGHUP</literal>,
<literal>SIGINT</literal>,
or
<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>
Useful utilities for dealing with shared memory problems include
<application>ipcs(1)</application>,
<application>ipcrm(1</application>), and
<application>ipcclean(1)</application>.
</para>
</para>
</refsect1>
</refsect1>
<refsect1 id="R1-APP-POSTMASTER-3">
<refsect1 id="app-postmaster-usage">
<refsect1info>
<title>Usage</title>
<date>1998-10-04</date>
</refsect1info>
<title>
Usage
</title>
<para>
<para>
To start <application>postmaster</application> using default
To start <application>postmaster</application> in the background
values, type:
using default values, type:
<programlisting>
$ nohup postmaster >logfile 2>&1 &
</programlisting>
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