|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/usr/share/doc/postgresql-8.1.9/html/ |
Upload File : |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Server Configuration</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.1.9 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="Server Administration"
HREF="admin.html"><LINK
REL="PREVIOUS"
TITLE="Secure TCP/IP Connections with SSH Tunnels"
HREF="ssh-tunnels.html"><LINK
REL="NEXT"
TITLE="File Locations"
HREF="runtime-config-file-locations.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-04-20T04:40:08"></HEAD
><BODY
CLASS="CHAPTER"
><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.1.9 Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="ssh-tunnels.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="runtime.html"
>Fast Backward</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="top"
><A
HREF="user-manag.html"
>Fast Forward</A
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="top"
><A
HREF="runtime-config-file-locations.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="RUNTIME-CONFIG"
></A
>Chapter 17. Server Configuration</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>17.1. <A
HREF="runtime-config.html#CONFIG-SETTING"
>Setting Parameters</A
></DT
><DT
>17.2. <A
HREF="runtime-config-file-locations.html"
>File Locations</A
></DT
><DT
>17.3. <A
HREF="runtime-config-connection.html"
>Connections and Authentication</A
></DT
><DD
><DL
><DT
>17.3.1. <A
HREF="runtime-config-connection.html#RUNTIME-CONFIG-CONNECTION-SETTINGS"
>Connection Settings</A
></DT
><DT
>17.3.2. <A
HREF="runtime-config-connection.html#RUNTIME-CONFIG-CONNECTION-SECURITY"
>Security and Authentication</A
></DT
></DL
></DD
><DT
>17.4. <A
HREF="runtime-config-resource.html"
>Resource Consumption</A
></DT
><DD
><DL
><DT
>17.4.1. <A
HREF="runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-MEMORY"
>Memory</A
></DT
><DT
>17.4.2. <A
HREF="runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-FSM"
>Free Space Map</A
></DT
><DT
>17.4.3. <A
HREF="runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-KERNEL"
>Kernel Resource Usage</A
></DT
><DT
>17.4.4. <A
HREF="runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-VACUUM-COST"
>Cost-Based Vacuum Delay</A
></DT
><DT
>17.4.5. <A
HREF="runtime-config-resource.html#RUNTIME-CONFIG-RESOURCE-BACKGROUND-WRITER"
>Background Writer</A
></DT
></DL
></DD
><DT
>17.5. <A
HREF="runtime-config-wal.html"
>Write Ahead Log</A
></DT
><DD
><DL
><DT
>17.5.1. <A
HREF="runtime-config-wal.html#RUNTIME-CONFIG-WAL-SETTINGS"
>Settings</A
></DT
><DT
>17.5.2. <A
HREF="runtime-config-wal.html#RUNTIME-CONFIG-WAL-CHECKPOINTS"
>Checkpoints</A
></DT
><DT
>17.5.3. <A
HREF="runtime-config-wal.html#RUNTIME-CONFIG-WAL-ARCHIVING"
>Archiving</A
></DT
></DL
></DD
><DT
>17.6. <A
HREF="runtime-config-query.html"
>Query Planning</A
></DT
><DD
><DL
><DT
>17.6.1. <A
HREF="runtime-config-query.html#RUNTIME-CONFIG-QUERY-ENABLE"
>Planner Method Configuration</A
></DT
><DT
>17.6.2. <A
HREF="runtime-config-query.html#RUNTIME-CONFIG-QUERY-CONSTANTS"
>Planner Cost Constants</A
></DT
><DT
>17.6.3. <A
HREF="runtime-config-query.html#RUNTIME-CONFIG-QUERY-GEQO"
>Genetic Query Optimizer</A
></DT
><DT
>17.6.4. <A
HREF="runtime-config-query.html#RUNTIME-CONFIG-QUERY-OTHER"
>Other Planner Options</A
></DT
></DL
></DD
><DT
>17.7. <A
HREF="runtime-config-logging.html"
>Error Reporting and Logging</A
></DT
><DD
><DL
><DT
>17.7.1. <A
HREF="runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHERE"
>Where To Log</A
></DT
><DT
>17.7.2. <A
HREF="runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN"
>When To Log</A
></DT
><DT
>17.7.3. <A
HREF="runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT"
>What To Log</A
></DT
></DL
></DD
><DT
>17.8. <A
HREF="runtime-config-statistics.html"
>Run-Time Statistics</A
></DT
><DD
><DL
><DT
>17.8.1. <A
HREF="runtime-config-statistics.html#RUNTIME-CONFIG-STATISTICS-MONITOR"
>Statistics Monitoring</A
></DT
><DT
>17.8.2. <A
HREF="runtime-config-statistics.html#RUNTIME-CONFIG-STATISTICS-COLLECTOR"
>Query and Index Statistics Collector</A
></DT
></DL
></DD
><DT
>17.9. <A
HREF="runtime-config-autovacuum.html"
>Automatic Vacuuming</A
></DT
><DT
>17.10. <A
HREF="runtime-config-client.html"
>Client Connection Defaults</A
></DT
><DD
><DL
><DT
>17.10.1. <A
HREF="runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT"
>Statement Behavior</A
></DT
><DT
>17.10.2. <A
HREF="runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT"
>Locale and Formatting</A
></DT
><DT
>17.10.3. <A
HREF="runtime-config-client.html#RUNTIME-CONFIG-CLIENT-OTHER"
>Other Defaults</A
></DT
></DL
></DD
><DT
>17.11. <A
HREF="runtime-config-locks.html"
>Lock Management</A
></DT
><DT
>17.12. <A
HREF="runtime-config-compatible.html"
>Version and Platform Compatibility</A
></DT
><DD
><DL
><DT
>17.12.1. <A
HREF="runtime-config-compatible.html#RUNTIME-CONFIG-COMPATIBLE-VERSION"
>Previous PostgreSQL Versions</A
></DT
><DT
>17.12.2. <A
HREF="runtime-config-compatible.html#RUNTIME-CONFIG-COMPATIBLE-CLIENTS"
>Platform and Client Compatibility</A
></DT
></DL
></DD
><DT
>17.13. <A
HREF="runtime-config-preset.html"
>Preset Options</A
></DT
><DT
>17.14. <A
HREF="runtime-config-custom.html"
>Customized Options</A
></DT
><DT
>17.15. <A
HREF="runtime-config-developer.html"
>Developer Options</A
></DT
><DT
>17.16. <A
HREF="runtime-config-short.html"
>Short Options</A
></DT
></DL
></DIV
><A
NAME="AEN18324"
></A
><P
> There are many configuration parameters that affect the behavior of
the database system. In the first section of this chapter, we
describe how to set configuration parameters. The subsequent sections
discuss each parameter in detail.
</P
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="CONFIG-SETTING"
>17.1. Setting Parameters</A
></H1
><P
> All parameter names are case-insensitive. Every parameter takes a
value of one of four types: Boolean, integer, floating point,
or string. Boolean values may be written as <TT
CLASS="LITERAL"
>ON</TT
>,
<TT
CLASS="LITERAL"
>OFF</TT
>, <TT
CLASS="LITERAL"
>TRUE</TT
>,
<TT
CLASS="LITERAL"
>FALSE</TT
>, <TT
CLASS="LITERAL"
>YES</TT
>,
<TT
CLASS="LITERAL"
>NO</TT
>, <TT
CLASS="LITERAL"
>1</TT
>, <TT
CLASS="LITERAL"
>0</TT
>
(all case-insensitive) or any unambiguous prefix of these.
</P
><P
> One way to set these parameters is to edit the file
<TT
CLASS="FILENAME"
>postgresql.conf</TT
><A
NAME="AEN18341"
></A
>,
which is normally kept in the data directory. (<TT
CLASS="COMMAND"
>initdb</TT
>
installs a default copy there.) An example of what this file might look
like is:
</P><PRE
CLASS="PROGRAMLISTING"
># This is a comment
log_connections = yes
log_destination = 'syslog'
search_path = '$user, public'</PRE
><P>
One parameter is specified per line. The equal sign between name and
value is optional. Whitespace is insignificant and blank lines are
ignored. Hash marks (<TT
CLASS="LITERAL"
>#</TT
>) introduce comments
anywhere. Parameter values that are not simple identifiers or
numbers must be single-quoted. To embed a single quote in a parameter
value, write either two quotes (preferred) or backslash-quote.
</P
><P
> <A
NAME="AEN18347"
></A
>
The configuration file is reread whenever the
<TT
CLASS="COMMAND"
>postmaster</TT
> process receives a
<SPAN
CLASS="SYSTEMITEM"
>SIGHUP</SPAN
> signal (which is most easily sent by means
of <TT
CLASS="LITERAL"
>pg_ctl reload</TT
>). The <TT
CLASS="COMMAND"
>postmaster</TT
>
also propagates this signal to all currently running server
processes so that existing sessions also get the new
value. Alternatively, you can send the signal to a single server
process directly. Some parameters can only be set at server start;
any changes to their entries in the configuration file will be ignored
until the server is restarted.
</P
><P
> A second way to set these configuration parameters is to give them
as a command line option to the <TT
CLASS="COMMAND"
>postmaster</TT
>, such as:
</P><PRE
CLASS="PROGRAMLISTING"
>postmaster -c log_connections=yes -c log_destination='syslog'</PRE
><P>
Command-line options override any conflicting settings in
<TT
CLASS="FILENAME"
>postgresql.conf</TT
>. Note that this means you won't
be able to change the value on-the-fly by editing
<TT
CLASS="FILENAME"
>postgresql.conf</TT
>, so while the command-line
method may be convenient, it can cost you flexibility later.
</P
><P
> Occasionally it is useful to give a command line option to
one particular session only. The environment variable
<TT
CLASS="ENVAR"
>PGOPTIONS</TT
> can be used for this purpose on the
client side:
</P><PRE
CLASS="PROGRAMLISTING"
>env PGOPTIONS='-c geqo=off' psql</PRE
><P>
(This works for any <SPAN
CLASS="APPLICATION"
>libpq</SPAN
>-based client application, not
just <SPAN
CLASS="APPLICATION"
>psql</SPAN
>.) Note that this won't work for
parameters that are fixed when the server is started or that must be
specified in <TT
CLASS="FILENAME"
>postgresql.conf</TT
>.
</P
><P
> Furthermore, it is possible to assign a set of option settings to
a user or a database. Whenever a session is started, the default
settings for the user and database involved are loaded. The
commands <A
HREF="sql-alteruser.html"
><I
>ALTER USER</I
></A
>
and <A
HREF="sql-alterdatabase.html"
><I
>ALTER DATABASE</I
></A
>,
respectively, are used to configure these settings. Per-database
settings override anything received from the
<TT
CLASS="COMMAND"
>postmaster</TT
> command-line or the configuration
file, and in turn are overridden by per-user settings; both are
overridden by per-session options.
</P
><P
> Some parameters can be changed in individual <ACRONYM
CLASS="ACRONYM"
>SQL</ACRONYM
>
sessions with the <A
HREF="sql-set.html"
><I
>SET</I
></A
>
command, for example:
</P><PRE
CLASS="SCREEN"
>SET ENABLE_SEQSCAN TO OFF;</PRE
><P>
If <TT
CLASS="COMMAND"
>SET</TT
> is allowed, it overrides all other sources of
values for the parameter. Some parameters cannot be changed via
<TT
CLASS="COMMAND"
>SET</TT
>: for example, if they control behavior that
cannot reasonably be changed without restarting
<SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>. Also, some parameters can
be modified via <TT
CLASS="COMMAND"
>SET</TT
> or <TT
CLASS="COMMAND"
>ALTER</TT
> by superusers,
but not by ordinary users.
</P
><P
> The <A
HREF="sql-show.html"
><I
>SHOW</I
></A
>
command allows inspection of the current values of all parameters.
</P
><P
> The virtual table <TT
CLASS="STRUCTNAME"
>pg_settings</TT
>
(described in <A
HREF="view-pg-settings.html"
>Section 42.41</A
>) also allows
displaying and updating session run-time parameters. It is equivalent
to <TT
CLASS="COMMAND"
>SHOW</TT
> and <TT
CLASS="COMMAND"
>SET</TT
>, but can be more convenient
to use because it can be joined with other tables, or selected from using
any desired selection condition.
</P
></DIV
></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="ssh-tunnels.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="runtime-config-file-locations.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Secure TCP/IP Connections with <SPAN
CLASS="APPLICATION"
>SSH</SPAN
> Tunnels</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="admin.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>File Locations</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>