Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > b8f4049de69feba5041d49ed4382e582 > files > 22

postgresql-docs-8.0.11-0.1.20060mdk.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>postmaster</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 8.0.11 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="PostgreSQL Server Applications"
HREF="reference-server.html"><LINK
REL="PREVIOUS"
TITLE="postgres"
HREF="app-postgres.html"><LINK
REL="NEXT"
TITLE="Internals"
HREF="internals.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2007-02-02T03:57:22"></HEAD
><BODY
CLASS="REFENTRY"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="5"
ALIGN="center"
VALIGN="bottom"
>PostgreSQL 8.0.11 Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="app-postgres.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="app-postgres.html"
>Fast Backward</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="top"
><A
HREF="internals.html"
>Fast Forward</A
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="top"
><A
HREF="internals.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="APP-POSTMASTER"
></A
><SPAN
CLASS="APPLICATION"
>postmaster</SPAN
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN51255"
></A
><H2
>Name</H2
>postmaster&nbsp;--&nbsp;<SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> multiuser database server</DIV
><A
NAME="AEN51259"
></A
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN51261"
></A
><H2
>Synopsis</H2
><P
><TT
CLASS="COMMAND"
>postmaster</TT
> [-A   0 | 1 ] [-B <TT
CLASS="REPLACEABLE"
><I
>nbuffers</I
></TT
>] [-c <TT
CLASS="REPLACEABLE"
><I
>name</I
></TT
>=<TT
CLASS="REPLACEABLE"
><I
>value</I
></TT
>] [-d <TT
CLASS="REPLACEABLE"
><I
>debug-level</I
></TT
>] [-D <TT
CLASS="REPLACEABLE"
><I
>datadir</I
></TT
>] [-F] [-h <TT
CLASS="REPLACEABLE"
><I
>hostname</I
></TT
>] [-i] [-k <TT
CLASS="REPLACEABLE"
><I
>directory</I
></TT
>] [-l] [-N <TT
CLASS="REPLACEABLE"
><I
>max-connections</I
></TT
>] [-o <TT
CLASS="REPLACEABLE"
><I
>extra-options</I
></TT
>] [-p <TT
CLASS="REPLACEABLE"
><I
>port</I
></TT
>] [-S] [--<TT
CLASS="REPLACEABLE"
><I
>name</I
></TT
>=<TT
CLASS="REPLACEABLE"
><I
>value</I
></TT
>] [-n | -s]</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN51297"
></A
><H2
>Description</H2
><P
>   <TT
CLASS="COMMAND"
>postmaster</TT
> is the
   <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> multiuser database server.
   In order for a client application to access a database it connects
   (over a network or locally) to a running
   <TT
CLASS="COMMAND"
>postmaster</TT
>.  The
   <TT
CLASS="COMMAND"
>postmaster</TT
> then starts a separate server
   process (<SPAN
CLASS="QUOTE"
>"<A
HREF="app-postgres.html"
><SPAN
CLASS="APPLICATION"
>postgres</SPAN
></A
>"</SPAN
>) to handle
   the connection.  The <TT
CLASS="COMMAND"
>postmaster</TT
> also
   manages the communication among server processes.
  </P
><P
>   By default the <TT
CLASS="COMMAND"
>postmaster</TT
> starts in the
   foreground and prints log messages to the standard error stream.  In
   practical applications the <TT
CLASS="COMMAND"
>postmaster</TT
>
   should be started as a background process, perhaps at boot time.
  </P
><P
>   One <TT
CLASS="COMMAND"
>postmaster</TT
> 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 (the <SPAN
CLASS="QUOTE"
>"data area"</SPAN
>).
   More than one <TT
CLASS="COMMAND"
>postmaster</TT
> process can run on a system
   at one time, so long as they use different data areas and different
   communication ports (see below).  A data area is created with <A
HREF="app-initdb.html"
>initdb</A
>.
  </P
><P
>   When the <TT
CLASS="COMMAND"
>postmaster</TT
> starts it needs 
   to know the location of the data area.
   The location must be specified by the <TT
CLASS="OPTION"
>-D</TT
> option
   or the <TT
CLASS="ENVAR"
>PGDATA</TT
> environment variable; there is no default.
   Typically, <TT
CLASS="OPTION"
>-D</TT
> or <TT
CLASS="ENVAR"
>PGDATA</TT
> points
   directly to the data area directory created by <SPAN
CLASS="APPLICATION"
>initdb</SPAN
>.
   Other possible file layouts are discussed in
   <A
HREF="runtime-config.html#RUNTIME-CONFIG-FILE-LOCATIONS"
>Section 16.4.1</A
>.
  </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="APP-POSTMASTER-OPTIONS"
></A
><H2
>Options</H2
><P
>    <TT
CLASS="COMMAND"
>postmaster</TT
> accepts the following
    command line arguments.  For a detailed discussion of the options
    consult <A
HREF="runtime-config.html"
>Section 16.4</A
>.  You can also save typing most of these
    options by setting up a configuration file.
    
    <P
></P
></P><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="OPTION"
>-A 0|1</TT
></DT
><DD
><P
>        Enables run-time assertion checks, which is a debugging aid to
        detect programming mistakes.  This option is only available if
        assertions were enabled when <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> was
        compiled. If so, the default is on.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-B <TT
CLASS="REPLACEABLE"
><I
>nbuffers</I
></TT
></TT
></DT
><DD
><P
>	Sets the number of shared buffers for use by the server
	processes.  The default value of this parameter is chosen
	automatically by <SPAN
CLASS="APPLICATION"
>initdb</SPAN
>; refer to <A
HREF="runtime-config.html#RUNTIME-CONFIG-RESOURCE-MEMORY"
>Section 16.4.3.1</A
> for more information.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-c <TT
CLASS="REPLACEABLE"
><I
>name</I
></TT
>=<TT
CLASS="REPLACEABLE"
><I
>value</I
></TT
></TT
></DT
><DD
><P
>        Sets a named run-time parameter. The configuration parameters
        supported by <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> are
        described in <A
HREF="runtime-config.html"
>Section 16.4</A
>. Most of the
        other command line options are in fact short forms of such a
        parameter assignment.  <TT
CLASS="OPTION"
>-c</TT
> can appear multiple times
        to set multiple parameters.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-d <TT
CLASS="REPLACEABLE"
><I
>debug-level</I
></TT
></TT
></DT
><DD
><P
>        Sets the debug level.  The higher this value is set, the more
        debugging output is written to the server log.  Values are from
        1 to 5.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-D <TT
CLASS="REPLACEABLE"
><I
>datadir</I
></TT
></TT
></DT
><DD
><P
>        Specifies the file system location of the data directory or
        configuration file(s).  See
        <A
HREF="runtime-config.html#RUNTIME-CONFIG-FILE-LOCATIONS"
>Section 16.4.1</A
> for details.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-F</TT
></DT
><DD
><P
>        Disables <CODE
CLASS="FUNCTION"
>fsync</CODE
> calls for improved
        performance, at the risk of data corruption in the event of a
        system crash.  Specifying this option is equivalent to
        disabling the <A
HREF="runtime-config.html#GUC-FSYNC"
>fsync</A
> configuration
        parameter. Read the detailed documentation before using this!
       </P
><P
>        <TT
CLASS="OPTION"
>--fsync=true</TT
> has the opposite effect
        of this option.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-h <TT
CLASS="REPLACEABLE"
><I
>hostname</I
></TT
></TT
></DT
><DD
><P
>        Specifies the IP host name or address on which the
        <TT
CLASS="COMMAND"
>postmaster</TT
> is to listen for TCP/IP
        connections from client applications.  The value can also be a
        comma-separated list of addresses, or <TT
CLASS="LITERAL"
>*</TT
> to specify
        listening on all available interfaces.  An empty value
        specifies not listening on any IP addresses, in which case
        only Unix-domain sockets can be used to connect to the
        <TT
CLASS="COMMAND"
>postmaster</TT
>.  Defaults to listening only on
        <SPAN
CLASS="SYSTEMITEM"
>localhost</SPAN
>.
        Specifying this option is equivalent to setting the <A
HREF="runtime-config.html#GUC-LISTEN-ADDRESSES"
>listen_addresses</A
> configuration parameter.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-i</TT
></DT
><DD
><P
>        Allows remote clients to connect via TCP/IP (Internet domain)
        connections.  Without this option, only local connections are
        accepted.  This option is equivalent to setting
        <TT
CLASS="VARNAME"
>listen_addresses</TT
> to <TT
CLASS="LITERAL"
>*</TT
> in
        <TT
CLASS="FILENAME"
>postgresql.conf</TT
> or via <TT
CLASS="OPTION"
>-h</TT
>.
       </P
><P
>        This option is deprecated since it does not allow access to the
        full functionality of <A
HREF="runtime-config.html#GUC-LISTEN-ADDRESSES"
>listen_addresses</A
>.
        It's usually better to set <TT
CLASS="VARNAME"
>listen_addresses</TT
> directly.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-k <TT
CLASS="REPLACEABLE"
><I
>directory</I
></TT
></TT
></DT
><DD
><P
>	Specifies the directory of the Unix-domain socket on which the
	<TT
CLASS="COMMAND"
>postmaster</TT
> is to listen for
	connections from client applications.  The default is normally
	<TT
CLASS="FILENAME"
>/tmp</TT
>, but can be changed at build time.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-l</TT
></DT
><DD
><P
>	Enables secure connections using <ACRONYM
CLASS="ACRONYM"
>SSL</ACRONYM
>.
	<SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> must have been compiled with
	support for <ACRONYM
CLASS="ACRONYM"
>SSL</ACRONYM
> for this option to be
	available. For more information on using <ACRONYM
CLASS="ACRONYM"
>SSL</ACRONYM
>,
	refer to <A
HREF="ssl-tcp.html"
>Section 16.8</A
>.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-N <TT
CLASS="REPLACEABLE"
><I
>max-connections</I
></TT
></TT
></DT
><DD
><P
>	Sets the maximum number of client connections that this
	<TT
CLASS="COMMAND"
>postmaster</TT
> will accept.  By
	default, this value is 32, but it can be set as high as your
	system will support.  (Note that
	<TT
CLASS="OPTION"
>-B</TT
> is required to be at least twice
	<TT
CLASS="OPTION"
>-N</TT
>.  See <A
HREF="kernel-resources.html"
>Section 16.5</A
> for a discussion of
	system resource requirements for large numbers of client
	connections.) Specifying this option is equivalent to setting the
	<A
HREF="runtime-config.html#GUC-MAX-CONNECTIONS"
>max_connections</A
> configuration parameter.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-o <TT
CLASS="REPLACEABLE"
><I
>extra-options</I
></TT
></TT
></DT
><DD
><P
>	The command line-style options specified in <TT
CLASS="REPLACEABLE"
><I
>extra-options</I
></TT
> are passed to
	all server processes started by this
	<TT
CLASS="COMMAND"
>postmaster</TT
>.  See <A
HREF="app-postgres.html"
><SPAN
CLASS="APPLICATION"
>postgres</SPAN
></A
> for possibilities.  If the option
	string contains any spaces, the entire string must be quoted.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-p <TT
CLASS="REPLACEABLE"
><I
>port</I
></TT
></TT
></DT
><DD
><P
>	Specifies the TCP/IP port or local Unix domain socket file
	extension on which the <TT
CLASS="COMMAND"
>postmaster</TT
>
	is to listen for connections from client applications.
	Defaults to the value of the <TT
CLASS="ENVAR"
>PGPORT</TT
> environment
	variable, or if <TT
CLASS="ENVAR"
>PGPORT</TT
> is not set, then
	defaults to the value established during compilation (normally
	5432).  If you specify a port other than the default port,
	then all client applications must specify the same port using
	either command-line options or <TT
CLASS="ENVAR"
>PGPORT</TT
>.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-S</TT
></DT
><DD
><P
>	Specifies that the <TT
CLASS="COMMAND"
>postmaster</TT
>
	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 <TT
CLASS="FILENAME"
>/dev/null</TT
>.
       </P
><P
>        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 <TT
CLASS="COMMAND"
>postmaster</TT
> in the background.
       </P
><P
>        <TT
CLASS="OPTION"
>--silent-mode=false</TT
> has the opposite effect
        of this option.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>--<TT
CLASS="REPLACEABLE"
><I
>name</I
></TT
>=<TT
CLASS="REPLACEABLE"
><I
>value</I
></TT
></TT
></DT
><DD
><P
>        Sets a named run-time parameter; a shorter form of
        <TT
CLASS="OPTION"
>-c</TT
>.
       </P
></DD
></DL
></DIV
><P>
   </P
><P
>    Two additional command line options are available for debugging
    problems that cause a server process to die abnormally.  The
    ordinary strategy in this situation is to notify all other server
    processes that they must terminate and then reinitialize the
    shared memory and semaphores.  This is because an errant server
    process could have corrupted some shared state before terminating.
    These options select alternative behaviors of the
    <TT
CLASS="COMMAND"
>postmaster</TT
> in this situation.
    <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Neither option is intended for use in ordinary
    operation.</I
></SPAN
>
   </P
><P
>   </P
><P
>    These special-case options are:

    <P
></P
></P><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="OPTION"
>-n</TT
></DT
><DD
><P
>	<TT
CLASS="COMMAND"
>postmaster</TT
>
	will not reinitialize shared data structures.  A knowledgeable system
	programmer can then use a debugger
	to examine shared memory and semaphore state.
       </P
></DD
><DT
><TT
CLASS="OPTION"
>-s</TT
></DT
><DD
><P
>	<TT
CLASS="COMMAND"
>postmaster</TT
>
	will stop all other server processes by sending the signal
	<TT
CLASS="LITERAL"
>SIGSTOP</TT
>,
	but will not cause them to terminate.  This permits system programmers
	to collect core dumps from all server processes by hand.
       </P
></DD
></DL
></DIV
><P>
   </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN51484"
></A
><H2
>Environment</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="ENVAR"
>PGCLIENTENCODING</TT
></DT
><DD
><P
>      Default character encoding used by clients.  (The clients may
      override this individually.)  This value can also be set in the
      configuration file.
     </P
></DD
><DT
><TT
CLASS="ENVAR"
>PGDATA</TT
></DT
><DD
><P
>      Default data directory location
     </P
></DD
><DT
><TT
CLASS="ENVAR"
>PGDATESTYLE</TT
></DT
><DD
><P
>      Default value of the <A
HREF="runtime-config.html#GUC-DATESTYLE"
>DateStyle</A
> run-time
      parameter.  (The use of this environment variable is deprecated.)
     </P
></DD
><DT
><TT
CLASS="ENVAR"
>PGPORT</TT
></DT
><DD
><P
>      Default port (preferably set in the configuration file)
     </P
></DD
><DT
><TT
CLASS="ENVAR"
>TZ</TT
></DT
><DD
><P
>      Server time zone
     </P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN51513"
></A
><H2
>Diagnostics</H2
><P
>    A failure message mentioning <TT
CLASS="LITERAL"
>semget</TT
> or <TT
CLASS="LITERAL"
>shmget</TT
>
    probably indicates you need to configure your kernel to provide adequate
    shared memory and semaphores.  For more discussion see <A
HREF="kernel-resources.html"
>Section 16.5</A
>.
   </P
><DIV
CLASS="TIP"
><BLOCKQUOTE
CLASS="TIP"
><P
><B
>Tip: </B
>     You may be able to postpone reconfiguring your kernel by
     decreasing <A
HREF="runtime-config.html#GUC-SHARED-BUFFERS"
>shared_buffers</A
> to reduce the
     shared memory consumption of <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>, and/or
     by reducing <A
HREF="runtime-config.html#GUC-MAX-CONNECTIONS"
>max_connections</A
> to reduce the
     semaphore consumption.
    </P
></BLOCKQUOTE
></DIV
><P
>    A failure message suggesting that another postmaster is already running
    should be checked carefully, for example by using the command
</P><PRE
CLASS="SCREEN"
><SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>ps ax | grep postmaster</KBD
></PRE
><P>
        or
</P><PRE
CLASS="SCREEN"
><SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>ps -ef | grep postmaster</KBD
></PRE
><P>
    depending on your system.  If you are certain that no conflicting
    postmaster is running, you may remove the lock file mentioned in the
    message and try again.
   </P
><P
>    A failure message indicating inability to bind to a port may
    indicate that that port is already in use by some
    non-<SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> process.  You may also
    get this error if you terminate the <TT
CLASS="COMMAND"
>postmaster</TT
>
    and immediately restart it using the same port; in this case, you
    must simply wait a few seconds until the operating system closes
    the port before trying again.  Finally, you may get this error if
    you specify a port number that your operating system considers to
    be reserved.  For example, many versions of Unix consider port
    numbers under 1024 to be <SPAN
CLASS="QUOTE"
>"trusted"</SPAN
> and only permit
    the Unix superuser to access them.
   </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN51535"
></A
><H2
>Notes</H2
><P
>   If at all possible, <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>do not</I
></SPAN
> use
   <TT
CLASS="LITERAL"
>SIGKILL</TT
> to kill the
   <TT
CLASS="COMMAND"
>postmaster</TT
>.  Doing so will prevent
   <TT
CLASS="COMMAND"
>postmaster</TT
> from freeing the system
   resources (e.g., shared memory and semaphores) that it holds before
   terminating.  This may cause problems for starting a fresh
   <TT
CLASS="COMMAND"
>postmaster</TT
> run.
  </P
><P
>   To terminate the <TT
CLASS="COMMAND"
>postmaster</TT
> normally,
   the signals <TT
CLASS="LITERAL"
>SIGTERM</TT
>, <TT
CLASS="LITERAL"
>SIGINT</TT
>,
   or <TT
CLASS="LITERAL"
>SIGQUIT</TT
> can be used.  The first will wait for
   all clients to terminate before quitting, the second will
   forcefully disconnect all clients, and the third will quit
   immediately without proper shutdown, resulting in a recovery run
   during restart.   The <TT
CLASS="LITERAL"
>SIGHUP</TT
> signal will 
   reload the server configuration files.
  </P
><P
>   The utility command <A
HREF="app-pg-ctl.html"
><SPAN
CLASS="APPLICATION"
>pg_ctl</SPAN
></A
> can be used to
   start and shut down the <TT
CLASS="COMMAND"
>postmaster</TT
>
   safely and comfortably.
  </P
><P
>   The <TT
CLASS="OPTION"
>--</TT
> options will not work on <SPAN
CLASS="SYSTEMITEM"
>FreeBSD</SPAN
> or <SPAN
CLASS="SYSTEMITEM"
>OpenBSD</SPAN
>.
   Use <TT
CLASS="OPTION"
>-c</TT
> instead. This is a bug in the affected operating
   systems; a future release of <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>
   will provide a workaround if this is not fixed.
  </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="APP-POSTMASTER-EXAMPLES"
></A
><H2
>Examples</H2
><P
>   To start <TT
CLASS="COMMAND"
>postmaster</TT
> in the background
   using default values, type:

</P><PRE
CLASS="SCREEN"
><SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>nohup postmaster &gt;logfile 2&gt;&amp;1 &lt;/dev/null &amp;</KBD
></PRE
><P>
  </P
><P
>   To start <TT
CLASS="COMMAND"
>postmaster</TT
> with a specific
   port:
</P><PRE
CLASS="SCREEN"
><SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>postmaster -p 1234</KBD
></PRE
><P>
   This command will start up <TT
CLASS="COMMAND"
>postmaster</TT
>
   communicating through the port 1234. In order to connect to this
   <TT
CLASS="COMMAND"
>postmaster</TT
> using <SPAN
CLASS="APPLICATION"
>psql</SPAN
>, you would need to
   run it as
</P><PRE
CLASS="SCREEN"
><SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>psql -p 1234</KBD
></PRE
><P>
   or set the environment variable <TT
CLASS="ENVAR"
>PGPORT</TT
>:
</P><PRE
CLASS="SCREEN"
><SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>export PGPORT=1234</KBD
>
<SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>psql</KBD
></PRE
><P>
  </P
><P
>   Named run-time parameters can be set in either of these styles:
</P><PRE
CLASS="SCREEN"
><SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>postmaster -c work_mem=1234</KBD
>
<SAMP
CLASS="PROMPT"
>$</SAMP
> <KBD
CLASS="USERINPUT"
>postmaster --work-mem=1234</KBD
></PRE
><P>
   Either form overrides whatever setting might exist for <TT
CLASS="VARNAME"
>work_mem</TT
>
   in <TT
CLASS="FILENAME"
>postgresql.conf</TT
>.  Notice that underscores in parameter
   names can be written as either underscore or dash on the command line.
  </P
><DIV
CLASS="TIP"
><BLOCKQUOTE
CLASS="TIP"
><P
><B
>Tip: </B
>   Except for short-term experiments,
   it's probably better practice to edit the setting in
   <TT
CLASS="FILENAME"
>postgresql.conf</TT
> than to rely on a command-line switch
   to set a parameter.
  </P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN51593"
></A
><H2
>See Also</H2
><P
>   <A
HREF="app-initdb.html"
>initdb</A
>,
   <A
HREF="app-pg-ctl.html"
><SPAN
CLASS="APPLICATION"
>pg_ctl</SPAN
></A
>
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="app-postgres.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="internals.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><SPAN
CLASS="APPLICATION"
>postgres</SPAN
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="reference-server.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Internals</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>