]> granicus.if.org Git - postgresql/blob - doc/src/sgml/config.sgml
Properly set "escape_string_warning" to default to true.
[postgresql] / doc / src / sgml / config.sgml
1 <!--
2 $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.51 2006/03/07 02:54:23 momjian Exp $
3 -->
4 <chapter Id="runtime-config">
5   <title>Server Configuration</title>
6
7   <indexterm>
8    <primary>configuration</primary>
9    <secondary>of the server</secondary>
10   </indexterm>
11
12   <para>
13    There are many configuration parameters that affect the behavior of
14    the database system. In the first section of this chapter, we
15    describe how to set configuration parameters. The subsequent sections
16    discuss each parameter in detail.
17   </para>
18
19   <sect1 id="config-setting">
20    <title>Setting Parameters</title>
21
22    <para>
23     All parameter names are case-insensitive. Every parameter takes a
24     value of one of four types: Boolean, integer, floating point,
25     or string. Boolean values may be written as <literal>ON</literal>,
26     <literal>OFF</literal>, <literal>TRUE</literal>,
27     <literal>FALSE</literal>, <literal>YES</literal>,
28     <literal>NO</literal>, <literal>1</literal>, <literal>0</literal>
29     (all case-insensitive) or any unambiguous prefix of these.
30    </para>
31
32    <para>
33     One way to set these parameters is to edit the file
34     <filename>postgresql.conf</><indexterm><primary>postgresql.conf</></>,
35     which is normally kept in the data directory. (<application>initdb</>
36     installs a default copy there.) An example of what this file might look
37     like is:
38 <programlisting>
39 # This is a comment
40 log_connections = yes
41 log_destination = 'syslog'
42 search_path = '"$user", public'
43 </programlisting>
44     One parameter is specified per line. The equal sign between name and
45     value is optional. Whitespace is insignificant and blank lines are
46     ignored. Hash marks (<literal>#</literal>) introduce comments
47     anywhere.  Parameter values that are not simple identifiers or
48     numbers must be single-quoted.  To embed a single quote in a parameter
49     value, write either two quotes (preferred) or backslash-quote.
50    </para>
51
52    <para>
53     <indexterm>
54      <primary><literal>include</></primary>
55      <secondary>in configuration file</secondary>
56     </indexterm>
57     In addition to parameter settings, the <filename>postgresql.conf</>
58     file can contain <firstterm>include directives</>, which specify
59     another file to read and process as if it were inserted into the
60     configuration file at this point.  Include directives simply look like
61 <programlisting>
62 include 'filename'
63 </programlisting>
64     If the filename is not an absolute path, it is taken as relative to
65     the directory containing the referencing configuration file.
66     Inclusions can be nested.
67    </para>
68
69    <para>
70     <indexterm>
71      <primary>SIGHUP</primary>
72     </indexterm>
73     The configuration file is reread whenever the
74     <command>postmaster</command> process receives a
75     <systemitem>SIGHUP</> signal (which is most easily sent by means
76     of <literal>pg_ctl reload</>). The <command>postmaster</command>
77     also propagates this signal to all currently running server
78     processes so that existing sessions also get the new
79     value. Alternatively, you can send the signal to a single server
80     process directly.  Some parameters can only be set at server start;
81     any changes to their entries in the configuration file will be ignored
82     until the server is restarted.
83    </para>
84
85    <para>
86     A second way to set these configuration parameters is to give them
87     as a command line option to the <command>postmaster</command>, such as:
88 <programlisting>
89 postmaster -c log_connections=yes -c log_destination='syslog'
90 </programlisting>
91     Command-line options override any conflicting settings in
92     <filename>postgresql.conf</filename>.  Note that this means you won't
93     be able to change the value on-the-fly by editing
94     <filename>postgresql.conf</filename>, so while the command-line
95     method may be convenient, it can cost you flexibility later.
96    </para>
97
98    <para>
99     Occasionally it is useful to give a command line option to
100     one particular session only. The environment variable
101     <envar>PGOPTIONS</envar> can be used for this purpose on the
102     client side:
103 <programlisting>
104 env PGOPTIONS='-c geqo=off' psql
105 </programlisting>
106     (This works for any <application>libpq</>-based client application, not
107     just <application>psql</application>.) Note that this won't work for
108     parameters that are fixed when the server is started or that must be
109     specified in <filename>postgresql.conf</filename>.
110    </para>
111
112    <para>
113     Furthermore, it is possible to assign a set of parameter settings to
114     a user or a database.  Whenever a session is started, the default
115     settings for the user and database involved are loaded.  The
116     commands <xref linkend="sql-alteruser" endterm="sql-alteruser-title">
117     and <xref linkend="sql-alterdatabase" endterm="sql-alterdatabase-title">,
118     respectively, are used to configure these settings.  Per-database
119     settings override anything received from the
120     <command>postmaster</command> command-line or the configuration
121     file, and in turn are overridden by per-user settings; both are
122     overridden by per-session settings.
123    </para>
124
125    <para>
126     Some parameters can be changed in individual <acronym>SQL</acronym>
127     sessions with the <xref linkend="SQL-SET" endterm="SQL-SET-title">
128     command, for example:
129 <screen>
130 SET ENABLE_SEQSCAN TO OFF;
131 </screen>
132     If <command>SET</> is allowed, it overrides all other sources of
133     values for the parameter. Some parameters cannot be changed via
134     <command>SET</command>: for example, if they control behavior that
135     cannot be changed without restarting the entire
136     <productname>PostgreSQL</productname> server.  Also, some parameters can
137     be modified via <command>SET</command> or <command>ALTER</> by superusers,
138     but not by ordinary users.
139    </para>
140
141    <para>
142     The <xref linkend="SQL-SHOW" endterm="SQL-SHOW-title">
143     command allows inspection of the current values of all parameters.
144    </para>
145
146    <para>
147     The virtual table <structname>pg_settings</structname>
148     (described in <xref linkend="view-pg-settings">) also allows
149     displaying and updating session run-time parameters.  It is equivalent
150     to <command>SHOW</> and <command>SET</>, but can be more convenient
151     to use because it can be joined with other tables, or selected from using
152     any desired selection condition.
153    </para>
154   </sect1>
155
156    <sect1 id="runtime-config-file-locations">
157     <title>File Locations</title>
158
159      <para>
160       In addition to the <filename>postgresql.conf</filename> file
161       already mentioned, <productname>PostgreSQL</productname> uses
162       two other manually-edited configuration files, which control
163       client authentication (their use is discussed in <xref
164       linkend="client-authentication">).  By default, all three
165       configuration files are stored in the database cluster's data
166       directory.  The parameters described in this section allow the
167       configuration files to be placed elsewhere.  (Doing so can ease
168       administration.  In particular it is often easier to ensure that
169       the configuration files are properly backed-up when they are
170       kept separate.)
171      </para>
172
173      <variablelist>
174      <varlistentry id="guc-data-directory" xreflabel="data_directory">
175       <term><varname>data_directory</varname> (<type>string</type>)</term>
176       <indexterm>
177        <primary><varname>data_directory</> configuration parameter</primary>
178       </indexterm>
179       <listitem>
180        <para>
181          Specifies the directory to use for data storage.
182          This parameter can only be set at server start.
183        </para>
184       </listitem>
185      </varlistentry>
186
187      <varlistentry id="guc-config-file" xreflabel="config_file">
188       <term><varname>config_file</varname> (<type>string</type>)</term>
189       <indexterm>
190        <primary><varname>config_file</> configuration parameter</primary>
191       </indexterm>
192       <listitem>
193        <para>
194          Specifies the main server configuration file
195          (customarily called <filename>postgresql.conf</>).
196          This parameter can only be set on the postmaster command line.
197        </para>
198       </listitem>
199      </varlistentry>
200
201      <varlistentry id="guc-hba-file" xreflabel="hba_file">
202       <term><varname>hba_file</varname> (<type>string</type>)</term>
203       <indexterm>
204        <primary><varname>hba_file</> configuration parameter</primary>
205       </indexterm>
206       <listitem>
207        <para>
208          Specifies the configuration file for host-based authentication
209          (customarily called <filename>pg_hba.conf</>).
210          This parameter can only be set at server start.
211        </para>
212       </listitem>
213      </varlistentry>
214
215      <varlistentry id="guc-ident-file" xreflabel="ident_file">
216       <term><varname>ident_file</varname> (<type>string</type>)</term>
217       <indexterm>
218        <primary><varname>ident_file</> configuration parameter</primary>
219       </indexterm>
220       <listitem>
221        <para>
222          Specifies the configuration file for
223          <application>ident</> authentication
224          (customarily called <filename>pg_ident.conf</>).
225          This parameter can only be set at server start.
226        </para>
227       </listitem>
228      </varlistentry>
229
230      <varlistentry id="guc-external-pid-file" xreflabel="external_pid_file">
231       <term><varname>external_pid_file</varname> (<type>string</type>)</term>
232       <indexterm>
233        <primary><varname>external_pid_file</> configuration parameter</primary>
234       </indexterm>
235       <listitem>
236        <para>
237         Specifies the name of an additional process-id (PID) file that the
238         <application>postmaster</> should create for use by server
239         administration programs.
240         This parameter can only be set at server start.
241        </para>
242       </listitem>
243      </varlistentry>
244      </variablelist>
245
246      <para>
247       In a default installation, none of the above parameters are set
248       explicitly.  Instead, the
249       data directory is specified by the <option>-D</option> command-line
250       option or the <envar>PGDATA</envar> environment variable, and the
251       configuration files are all found within the data directory.
252      </para>
253
254      <para>
255       If you wish to keep the configuration files elsewhere than the
256       data directory, the postmaster's <option>-D</option>
257       command-line option or <envar>PGDATA</envar> environment variable
258       must point to the directory containing the configuration files,
259       and the <varname>data_directory</> parameter must be set in
260       <filename>postgresql.conf</filename> (or on the command line) to show
261       where the data directory is actually located.  Notice that
262       <varname>data_directory</> overrides <option>-D</option> and
263       <envar>PGDATA</envar> for the location
264       of the data directory, but not for the location of the configuration
265       files.
266      </para>
267
268      <para>
269       If you wish, you can specify the configuration file names and locations
270       individually using the parameters <varname>config_file</>,
271       <varname>hba_file</> and/or <varname>ident_file</>.
272       <varname>config_file</> can only be specified on the 
273       <command>postmaster</command> command line, but the others can be
274       set within the main configuration file.  If all three parameters plus
275       <varname>data_directory</> are explicitly set, then it is not necessary
276       to specify <option>-D</option> or <envar>PGDATA</envar>.
277      </para>
278
279      <para>
280       When setting any of these parameters, a relative path will be interpreted
281       with respect to the directory in which the <command>postmaster</command>
282       is started.
283      </para>
284    </sect1>
285
286    <sect1 id="runtime-config-connection">
287     <title>Connections and Authentication</title>
288
289     <sect2 id="runtime-config-connection-settings">
290      <title>Connection Settings</title>
291
292      <variablelist>
293
294      <varlistentry id="guc-listen-addresses" xreflabel="listen_addresses">
295       <term><varname>listen_addresses</varname> (<type>string</type>)</term>
296       <indexterm>
297        <primary><varname>listen_addresses</> configuration parameter</primary>
298       </indexterm>
299       <listitem>
300        <para>
301          Specifies the TCP/IP address(es) on which the server is
302          to listen for connections from client applications.  
303          The value takes the form of a comma-separated list of host names
304          and/or numeric IP addresses.  The special entry <literal>*</>
305          corresponds to all available IP interfaces.
306          If the list is empty, the server does not listen on any IP interface
307          at all, in which case only Unix-domain sockets can be used to connect
308          to it.
309          The default value is <systemitem class="systemname">localhost</>,
310          which allows only local <quote>loopback</> connections to be made.
311          This parameter can only be set at server start.
312        </para>
313       </listitem>
314      </varlistentry>
315
316      <varlistentry id="guc-port" xreflabel="port">
317       <term><varname>port</varname> (<type>integer</type>)</term>
318       <indexterm>
319        <primary><varname>port</> configuration parameter</primary>
320       </indexterm>
321       <listitem>
322        <para>
323         The TCP port the server listens on; 5432 by default.  Note that the
324         same port number is used for all IP addresses the server listens on.
325         This parameter can only be set at server start.
326        </para>
327       </listitem>
328      </varlistentry>
329
330      <varlistentry id="guc-max-connections" xreflabel="max_connections">
331       <term><varname>max_connections</varname> (<type>integer</type>)</term>
332       <indexterm>
333        <primary><varname>max_connections</> configuration parameter</primary>
334       </indexterm>
335       <listitem>
336        <para>
337         Determines the maximum number of concurrent connections to the
338         database server. The default is typically 100, but may be less
339         if your kernel settings will not support it (as determined
340         during <application>initdb</>).  This parameter can only be
341         set at server start.
342        </para>
343
344        <para>
345         Increasing this parameter may cause <productname>PostgreSQL</>
346         to request more <systemitem class="osname">System V</> shared
347         memory or semaphores than your operating system's default configuration
348         allows. See <xref linkend="sysvipc"> for information on how to
349         adjust those parameters, if necessary.
350        </para>
351       </listitem>
352      </varlistentry>
353      
354      <varlistentry id="guc-superuser-reserved-connections"
355      xreflabel="superuser_reserved_connections">
356       <term><varname>superuser_reserved_connections</varname>
357       (<type>integer</type>)</term>
358       <indexterm>
359        <primary><varname>superuser_reserved_connections</> configuration parameter</primary>
360       </indexterm>
361       <listitem>
362        <para>
363         Determines the number of connection <quote>slots</quote> that
364         are reserved for connections by <productname>PostgreSQL</>
365         superusers.  At most <xref linkend="guc-max-connections">
366         connections can ever be active simultaneously.  Whenever the
367         number of active concurrent connections is at least
368         <varname>max_connections</> minus
369         <varname>superuser_reserved_connections</varname>, new
370         connections will be accepted only for superusers.
371        </para>
372
373        <para>
374         The default value is 2. The value must be less than the value of
375         <varname>max_connections</varname>. This parameter can only be
376         set at server start.
377        </para>
378       </listitem>
379      </varlistentry>
380
381      <varlistentry id="guc-unix-socket-directory" xreflabel="unix_socket_directory">
382       <term><varname>unix_socket_directory</varname> (<type>string</type>)</term>
383       <indexterm>
384        <primary><varname>unix_socket_directory</> configuration parameter</primary>
385       </indexterm>
386       <listitem>
387        <para>
388         Specifies the directory of the Unix-domain socket on which the
389         server is to listen for
390         connections from client applications.  The default is normally
391         <filename>/tmp</filename>, but can be changed at build time.
392         This parameter can only be set at server start.
393        </para>
394       </listitem>
395      </varlistentry>
396
397      <varlistentry id="guc-unix-socket-group" xreflabel="unix_socket_group">
398       <term><varname>unix_socket_group</varname> (<type>string</type>)</term>
399       <indexterm>
400        <primary><varname>unix_socket_group</> configuration parameter</primary>
401       </indexterm>
402       <listitem>
403        <para>
404         Sets the owning group of the Unix-domain socket.  (The owning
405         user of the socket is always the user that starts the
406         server.)  In combination with the parameter
407         <varname>unix_socket_permissions</varname> this can be used as
408         an additional access control mechanism for Unix-domain connections.
409         By default this is the empty string, which selects the default
410         group for the current user.  This parameter can only be set at
411         server start.
412        </para>
413       </listitem>
414      </varlistentry>
415
416      <varlistentry id="guc-unix-socket-permissions" xreflabel="unix_socket_permissions">
417       <term><varname>unix_socket_permissions</varname> (<type>integer</type>)</term>
418       <indexterm>
419        <primary><varname>unix_socket_permissions</> configuration parameter</primary>
420       </indexterm>
421       <listitem>
422        <para>
423         Sets the access permissions of the Unix-domain socket.  Unix-domain
424         sockets use the usual Unix file system permission set.
425         The parameter value is expected to be a numeric mode
426         specification in the form accepted by the
427         <function>chmod</function> and <function>umask</function>
428         system calls.  (To use the customary octal format the number
429         must start with a <literal>0</literal> (zero).)
430        </para>
431
432        <para>
433         The default permissions are <literal>0777</literal>, meaning
434         anyone can connect. Reasonable alternatives are
435         <literal>0770</literal> (only user and group, see also
436         <varname>unix_socket_group</varname>) and <literal>0700</literal>
437         (only user). (Note that for a Unix-domain socket, only write
438         permission matters and so there is no point in setting or revoking
439         read or execute permissions.)
440        </para>
441
442        <para>
443         This access control mechanism is independent of the one
444         described in <xref linkend="client-authentication">.
445        </para>
446
447        <para>
448         This parameter can only be set at server start.
449        </para>
450       </listitem>
451      </varlistentry>
452      
453      <varlistentry id="guc-bonjour-name" xreflabel="bonjour_name">
454       <term><varname>bonjour_name</varname> (<type>string</type>)</term>
455       <indexterm>
456        <primary><varname>bonjour_name</> configuration parameter</primary>
457       </indexterm>
458       <listitem>
459        <para>
460         Specifies the <productname>Bonjour</productname> broadcast
461         name.  The computer name is used if this parameter is set to the
462         empty string <literal>''</> (which is the default).  This parameter is
463         ignored if the server was not compiled with
464         <productname>Bonjour</productname> support.
465         This parameter can only be set at server start.
466        </para>
467       </listitem>
468      </varlistentry>
469      
470      <varlistentry id="guc-tcp-keepalives-idle" xreflabel="tcp_keepalives_idle">
471       <term><varname>tcp_keepalives_idle</varname> (<type>integer</type>)</term>
472       <indexterm>
473        <primary><varname>tcp_keepalives_idle</> configuration parameter</primary>
474       </indexterm>
475       <listitem>
476        <para>
477         On systems that support the <symbol>TCP_KEEPIDLE</symbol> socket option, specifies the
478         number of seconds between sending keepalives on an otherwise idle
479         connection. A value of 0 uses the system default. If <symbol>TCP_KEEPIDLE</symbol> is
480         not supported, this parameter must be 0. This parameter is ignored for
481         connections made via a Unix-domain socket.
482        </para>
483       </listitem>
484      </varlistentry>
485      
486      <varlistentry id="guc-tcp-keepalives-interval" xreflabel="tcp_keepalives_interval">
487       <term><varname>tcp_keepalives_interval</varname> (<type>integer</type>)</term>
488       <indexterm>
489        <primary><varname>tcp_keepalives_interval</> configuration parameter</primary>
490       </indexterm>
491       <listitem>
492        <para>
493         On systems that support the <symbol>TCP_KEEPINTVL</symbol> socket option, specifies how
494         long, in seconds, to wait for a response to a keepalive before
495         retransmitting. A value of 0 uses the system default. If <symbol>TCP_KEEPINTVL</symbol>
496         is not supported, this parameter must be 0. This parameter is ignored
497         for connections made via a Unix-domain socket.
498        </para>
499       </listitem>
500      </varlistentry>
501      
502      <varlistentry id="guc-tcp-keepalives-count" xreflabel="tcp_keepalives_count">
503       <term><varname>tcp_keepalives_count</varname> (<type>integer</type>)</term>
504       <indexterm>
505        <primary><varname>tcp_keepalives_count</> configuration parameter</primary>
506       </indexterm>
507       <listitem>
508        <para>
509         On systems that support the <symbol>TCP_KEEPCNT</symbol> socket option, specifies how
510         many keepalives may be lost before the connection is considered dead. 
511         A value of 0 uses the system default. If <symbol>TCP_KEEPCNT</symbol> is not
512         supported, this parameter must be 0. This parameter is ignored
513         for connections made via a Unix-domain socket.
514        </para>
515       </listitem>
516      </varlistentry>
517      
518      </variablelist>
519      </sect2>
520      <sect2 id="runtime-config-connection-security">
521      <title>Security and Authentication</title>
522      
523      <variablelist>
524      <varlistentry id="guc-authentication-timeout" xreflabel="authentication_timeout">
525       <term><varname>authentication_timeout</varname> (<type>integer</type>)</term>
526       <indexterm><primary>timeout</><secondary>client authentication</></indexterm>
527       <indexterm><primary>client authentication</><secondary>timeout during</></indexterm>
528       <indexterm>
529        <primary><varname>authentication_timeout</> configuration parameter</primary>
530       </indexterm>
531
532       <listitem>
533        <para>
534         Maximum time to complete client authentication, in seconds. If a
535         would-be client has not completed the authentication protocol in
536         this much time, the server breaks the connection. This prevents
537         hung clients from occupying a connection indefinitely.
538         The default is 60.
539         This parameter can only be set in the <filename>postgresql.conf</>
540         file or on the server command line.
541        </para>
542       </listitem>
543      </varlistentry>
544      
545      <varlistentry id="guc-ssl" xreflabel="ssl">
546       <term><varname>ssl</varname> (<type>boolean</type>)</term>
547       <indexterm>
548        <primary><varname>ssl</> configuration parameter</primary>
549       </indexterm>
550       <listitem>
551        <para>
552         Enables <acronym>SSL</> connections. Please read
553         <xref linkend="ssl-tcp"> before using this. The default
554         is <literal>off</>. This parameter can only be set at server
555         start.
556        </para>
557       </listitem>
558      </varlistentry>
559
560      <varlistentry id="guc-password-encryption" xreflabel="password_encryption">
561       <term><varname>password_encryption</varname> (<type>boolean</type>)</term>
562       <indexterm>
563        <primary><varname>password_encryption</> configuration parameter</primary>
564       </indexterm>
565       <listitem>
566        <para>
567         When a password is specified in <xref
568         linkend="sql-createuser" endterm="sql-createuser-title"> or
569         <xref linkend="sql-alteruser" endterm="sql-alteruser-title">
570         without writing either <literal>ENCRYPTED</> or
571         <literal>UNENCRYPTED</>, this parameter determines whether the
572         password is to be encrypted. The default is <literal>on</>
573         (encrypt the password).
574        </para>
575       </listitem>
576      </varlistentry>
577
578      <varlistentry id="guc-krb-server-keyfile" xreflabel="krb_server_keyfile">
579       <term><varname>krb_server_keyfile</varname> (<type>string</type>)</term>
580       <indexterm>
581        <primary><varname>krb_server_keyfile</> configuration parameter</primary>
582       </indexterm>
583       <listitem>
584        <para>
585         Sets the location of the Kerberos server key file. See
586         <xref linkend="kerberos-auth"> for details. This parameter
587         can only be set at server start.
588        </para>
589       </listitem>
590      </varlistentry>
591
592      <varlistentry id="guc-krb-srvname" xreflabel="krb_srvname">
593       <term><varname>krb_srvname</varname> (<type>string</type>)</term>
594       <indexterm>
595        <primary><varname>krb_srvname</> configuration parameter</primary>
596       </indexterm>
597       <listitem>
598        <para>
599         Sets the Kerberos service name. See <xref linkend="kerberos-auth">
600         for details.  This parameter can only be set at server start.
601        </para>
602       </listitem>
603      </varlistentry>
604
605      <varlistentry id="guc-krb-server-hostname" xreflabel="krb_server_hostname">
606       <term><varname>krb_server_hostname</varname> (<type>string</type>)</term>
607       <indexterm>
608        <primary><varname>krb_server_hostname</> configuration parameter</primary>
609       </indexterm>
610       <listitem>
611        <para>
612         Sets the host name part of the service principal.
613         This, combined with <varname>krb_srvname</>, is used to generate
614         the complete service principal, that is
615         <varname>krb_srvname</><literal>/</><varname>krb_server_hostname</><literal>@</>REALM.
616         If not set, the default is the server host name.  See <xref linkend="kerberos-auth">
617         for details.  This parameter can only be set at server start.
618        </para>
619       </listitem>
620      </varlistentry>
621
622      <varlistentry id="guc-krb-caseins-users" xreflabel="krb_caseins_users">
623       <term><varname>krb_caseins_users</varname> (<type>boolean</type>)</term>
624       <indexterm>
625        <primary><varname>krb_caseins_users</varname> configuration parameter</primary>
626       </indexterm>
627       <listitem>
628        <para>
629         Sets whether Kerberos user names should be treated case-insensitively.
630         The default is <literal>off</> (case sensitive). This parameter
631         can only be set at server start.
632        </para>
633       </listitem>
634      </varlistentry>
635
636      <varlistentry id="guc-db-user-namespace" xreflabel="db_user_namespace">
637       <term><varname>db_user_namespace</varname> (<type>boolean</type>)</term>
638       <indexterm>
639        <primary><varname>db_user_namespace</> configuration parameter</primary>
640       </indexterm>
641       <listitem>
642        <para>
643         This parameter enables per-database user names.  It is off by default.
644         This parameter can only be set in the <filename>postgresql.conf</>
645         file or on the server command line.
646        </para>
647
648        <para>
649         If this is on, you should create users as <literal>username@dbname</>.
650         When <literal>username</> is passed by a connecting client,
651         <literal>@</> and the database name are appended to the user
652         name and that database-specific user name is looked up by the
653         server. Note that when you create users with names containing
654         <literal>@</> within the SQL environment, you will need to
655         quote the user name.
656        </para>
657
658        <para>
659         With this parameter enabled, you can still create ordinary global
660         users.  Simply append <literal>@</> when specifying the user
661         name in the client.  The <literal>@</> will be stripped off
662         before the user name is looked up by the server.
663        </para>
664
665        <note>
666         <para>
667          This feature is intended as a temporary measure until a
668          complete solution is found.  At that time, this option will
669          be removed.
670         </para>
671        </note>
672       </listitem>
673      </varlistentry>
674
675     </variablelist>
676     </sect2>
677    </sect1>
678
679    <sect1 id="runtime-config-resource">
680     <title>Resource Consumption</title>
681
682     <sect2 id="runtime-config-resource-memory">
683      <title>Memory</title>
684
685      <variablelist>
686      <varlistentry id="guc-shared-buffers" xreflabel="shared_buffers">
687       <term><varname>shared_buffers</varname> (<type>integer</type>)</term>
688       <indexterm>
689        <primary><varname>shared_buffers</> configuration parameter</primary>
690       </indexterm>
691       <listitem>
692        <para>
693         Sets the number of shared memory buffers used by the database
694         server. The default is typically 4000, but may be less if your
695         kernel settings will not support it (as determined during
696         <application>initdb</>).  Each buffer is 8192 bytes, unless a
697         different value of <symbol>BLCKSZ</symbol> was chosen when building
698         the server.  This setting must be at least 16, as well as at
699         least twice the value of <xref linkend="guc-max-connections">;
700         however, settings significantly higher than the minimum are
701         usually needed for good performance.  Values of a few thousand
702         are recommended for production installations.  This parameter can
703         only be set at server start.
704        </para>
705
706        <para>
707         Increasing this parameter may cause <productname>PostgreSQL</>
708         to request more <systemitem class="osname">System V</> shared
709         memory than your operating system's default configuration
710         allows. See <xref linkend="sysvipc"> for information on how to
711         adjust those parameters, if necessary.
712        </para>
713       </listitem>
714      </varlistentry>
715
716      <varlistentry id="guc-temp-buffers" xreflabel="temp_buffers">
717       <term><varname>temp_buffers</varname> (<type>integer</type>)</term>
718       <indexterm>
719        <primary><varname>temp_buffers</> configuration parameter</primary>
720       </indexterm>
721       <listitem>
722        <para>
723         Sets the maximum number of temporary buffers used by each database
724         session.  These are session-local buffers used only for access
725         to temporary tables.  The default is 1000.  The setting can
726         be changed within individual sessions, but only up until the
727         first use of temporary tables within a session; subsequent
728         attempts to change the value will have no effect on that session.
729        </para>
730
731        <para>
732         A session will allocate temporary buffers as needed up to the limit
733         given by <varname>temp_buffers</>.  The cost of setting a large
734         value in sessions that do not actually need a lot of temporary
735         buffers is only a buffer descriptor, or about 64 bytes, per
736         increment in <varname>temp_buffers</>.  However if a buffer is
737         actually used an additional 8192 bytes will be consumed for it
738         (or in general, <symbol>BLCKSZ</symbol> bytes).
739        </para>
740       </listitem>
741      </varlistentry>
742
743      <varlistentry id="guc-max-prepared-transactions" xreflabel="max_prepared_transactions">
744       <term><varname>max_prepared_transactions</varname> (<type>integer</type>)</term>
745       <indexterm>
746        <primary><varname>max_prepared_transactions</> configuration parameter</primary>
747       </indexterm>
748       <listitem>
749        <para>
750         Sets the maximum number of transactions that can be in the
751         <quote>prepared</> state simultaneously (see <xref
752         linkend="sql-prepare-transaction"
753         endterm="sql-prepare-transaction-title">).
754         Setting this parameter to zero disables the prepared-transaction
755         feature.
756         The default is 5.
757         This parameter can only be set at server start.
758        </para>
759
760        <para>
761         If you are not using prepared transactions, this parameter may as
762         well be set to zero.  If you are using them, you will probably
763         want <varname>max_prepared_transactions</varname> to be at least
764         as large as <xref linkend="guc-max-connections">, to avoid unwanted
765         failures at the prepare step.
766        </para>
767
768        <para>
769         Increasing this parameter may cause <productname>PostgreSQL</>
770         to request more <systemitem class="osname">System V</> shared
771         memory than your operating system's default configuration
772         allows. See <xref linkend="sysvipc"> for information on how to
773         adjust those parameters, if necessary.
774        </para>
775       </listitem>
776      </varlistentry>
777
778      <varlistentry id="guc-work-mem" xreflabel="work_mem">
779       <term><varname>work_mem</varname> (<type>integer</type>)</term>
780       <indexterm>
781        <primary><varname>work_mem</> configuration parameter</primary>
782       </indexterm>
783       <listitem>
784        <para>
785         Specifies the amount of memory to be used by internal sort operations
786         and hash tables before switching to temporary disk files. The value is
787         specified in kilobytes, and defaults to 1024 kilobytes (1 MB).
788         Note that for a complex query, several sort or hash operations might be
789         running in parallel; each one will be allowed to use as much memory
790         as this value specifies before it starts to put data into temporary
791         files. Also, several running sessions could be doing such operations
792         concurrently.  So the total memory used could be many
793         times the value of <varname>work_mem</varname>; it is necessary to
794         keep this fact in mind when choosing the value. Sort operations are
795         used for <literal>ORDER BY</>, <literal>DISTINCT</>, and
796         merge joins.
797         Hash tables are used in hash joins, hash-based aggregation, and
798         hash-based processing of <literal>IN</> subqueries.
799        </para>
800       </listitem>
801      </varlistentry>
802      
803      <varlistentry id="guc-maintenance-work-mem" xreflabel="maintenance_work_mem">
804       <term><varname>maintenance_work_mem</varname> (<type>integer</type>)</term>
805       <indexterm>
806        <primary><varname>maintenance_work_mem</> configuration parameter</primary>
807       </indexterm>
808       <listitem>
809        <para>
810         Specifies the maximum amount of memory to be used in maintenance
811         operations, such as <command>VACUUM</command>, <command>CREATE
812         INDEX</>, and <command>ALTER TABLE ADD FOREIGN KEY</>.
813         The value is specified in kilobytes, and defaults to 16384 kilobytes
814         (16 MB).  Since only one of these operations can be executed at 
815         a time by a database session, and an installation normally doesn't
816         have very many of them happening concurrently, it's safe to set this
817         value significantly larger than <varname>work_mem</varname>.  Larger
818         settings may improve performance for vacuuming and for restoring
819         database dumps.
820        </para>
821       </listitem>
822      </varlistentry>
823
824      <varlistentry id="guc-max-stack-depth" xreflabel="max_stack_depth">
825       <term><varname>max_stack_depth</varname> (<type>integer</type>)</term>
826       <indexterm>
827        <primary><varname>max_stack_depth</> configuration parameter</primary>
828       </indexterm>
829       <listitem>
830        <para>
831         Specifies the maximum safe depth of the server's execution stack.
832         The ideal setting for this parameter is the actual stack size limit
833         enforced by the kernel (as set by <literal>ulimit -s</> or local
834         equivalent), less a safety margin of a megabyte or so.  The safety
835         margin is needed because the stack depth is not checked in every
836         routine in the server, but only in key potentially-recursive routines
837         such as expression evaluation.  Setting the parameter higher than
838         the actual kernel limit will mean that a runaway recursive function
839         can crash an individual backend process.  The default setting is
840         2048 KB (two megabytes), which is conservatively small and unlikely
841         to risk crashes.  However, it may be too small to allow execution
842         of complex functions.
843         Only superusers can change this setting.
844        </para>
845       </listitem>
846      </varlistentry>
847
848      </variablelist>
849      </sect2>
850      <sect2 id="runtime-config-resource-fsm">
851      <title>Free Space Map</title>
852
853      <indexterm>
854       <primary>free space map</primary>
855      </indexterm>
856
857      <para>
858       These parameters control the size of the shared <firstterm>free space
859       map</>, which tracks the locations of unused space in the database.
860       An undersized free space map may cause the database to consume
861       increasing amounts of disk space over time, because free space that
862       is not in the map cannot be re-used; instead <productname>PostgreSQL</>
863       will request more disk space from the operating system when it needs
864       to store new data.
865       The last few lines displayed by a database-wide <command>VACUUM VERBOSE</> 
866       command can help in determining if the current settings are adequate.
867       A <literal>NOTICE</> message is also printed during such an operation
868       if the current settings are too low.
869      </para>
870
871      <para>
872       Increasing these parameters may cause <productname>PostgreSQL</>
873       to request more <systemitem class="osname">System V</> shared
874       memory than your operating system's default configuration
875       allows. See <xref linkend="sysvipc"> for information on how to
876       adjust those parameters, if necessary.
877      </para>
878
879      <variablelist>
880      <varlistentry id="guc-max-fsm-pages" xreflabel="max_fsm_pages">
881       <term><varname>max_fsm_pages</varname> (<type>integer</type>)</term>
882       <indexterm>
883        <primary><varname>max_fsm_pages</> configuration parameter</primary>
884       </indexterm>
885       <listitem>
886        <para>
887         Sets the maximum number of disk pages for which free space will
888         be tracked in the shared free-space map.  Six bytes of shared memory
889         are consumed for each page slot.  This setting must be more than
890         16 * <varname>max_fsm_relations</varname>.  The default is chosen
891         by <application>initdb</> depending on the amount of available memory,
892         and can range from 20000 to 200000.
893         This parameter can only be set at server start.
894        </para>
895       </listitem>
896      </varlistentry>
897
898      <varlistentry id="guc-max-fsm-relations" xreflabel="max_fsm_relations">
899       <term><varname>max_fsm_relations</varname> (<type>integer</type>)</term>
900       <indexterm>
901        <primary><varname>max_fsm_relations</> configuration parameter</primary>
902       </indexterm>
903       <listitem>
904        <para>
905         Sets the maximum number of relations (tables and indexes) for which
906         free space will be tracked in the shared free-space map.  Roughly
907         seventy bytes of shared memory are consumed for each slot.
908         The default is 1000.
909         This parameter can only be set at server start.
910        </para>
911       </listitem>
912      </varlistentry>
913      
914      </variablelist>
915      </sect2>
916      <sect2 id="runtime-config-resource-kernel">
917      <title>Kernel Resource Usage</title>
918      <variablelist>
919
920      <varlistentry id="guc-max-files-per-process" xreflabel="max_files_per_process">
921       <term><varname>max_files_per_process</varname> (<type>integer</type>)</term>
922       <indexterm>
923        <primary><varname>max_files_per_process</> configuration parameter</primary>
924       </indexterm>
925       <listitem>
926        <para>
927         Sets the maximum number of simultaneously open files allowed to each
928         server subprocess. The default is 1000. If the kernel is enforcing
929         a safe per-process limit, you don't need to worry about this setting.
930         But on some platforms (notably, most BSD systems), the kernel will
931         allow individual processes to open many more files than the system
932         can really support when a large number of processes all try to open
933         that many files. If you find yourself seeing <quote>Too many open
934         files</> failures, try reducing this setting.
935         This parameter can only be set at server start.
936        </para>
937       </listitem>
938      </varlistentry>
939      
940      <varlistentry id="guc-preload-libraries" xreflabel="preload_libraries">
941       <term><varname>preload_libraries</varname> (<type>string</type>)</term>
942       <indexterm>
943        <primary><varname>preload_libraries</> configuration parameter</primary>
944       </indexterm>
945       <listitem>
946        <para>
947         This variable specifies one or more shared libraries that are
948         to be preloaded at server start. A parameterless
949         initialization function can optionally be called for each
950         library.  To specify that, add a colon and the name of the
951         initialization function after the library name. For example
952         <literal>'$libdir/mylib:mylib_init'</literal> would cause
953         <literal>mylib</> to be preloaded and <literal>mylib_init</>
954         to be executed. If more than one library is to be loaded,
955         separate their names with commas.
956        </para>
957
958        <para>
959         If a specified library or initialization function is not found,
960         the server will fail to start.
961        </para>
962
963        <para>
964         <productname>PostgreSQL</productname> procedural language
965         libraries may be preloaded in this way, typically by using the
966         syntax <literal>'$libdir/plXXX:plXXX_init'</literal> where
967         <literal>XXX</literal> is <literal>pgsql</>, <literal>perl</>,
968         <literal>tcl</>, or <literal>python</>.
969        </para>
970
971        <para>
972         By preloading a shared library (and initializing it if
973         applicable), the library startup time is avoided when the
974         library is first used.  However, the time to start each new
975         server process may increase slightly, even if that process never
976         uses the library.  So this parameter is recommended only for
977         libraries that will be used in most sessions.
978        </para>
979       </listitem>
980      </varlistentry>
981
982      </variablelist>
983     </sect2>
984
985     <sect2 id="runtime-config-resource-vacuum-cost">
986      <title id="runtime-config-resource-vacuum-cost-title">
987        Cost-Based Vacuum Delay
988      </title>
989
990      <para>
991       During the execution of <xref linkend="sql-vacuum"
992       endterm="sql-vacuum-title"> and <xref linkend="sql-analyze"
993       endterm="sql-analyze-title"> commands, the system maintains an
994       internal counter that keeps track of the estimated cost of the
995       various I/O operations that are performed.  When the accumulated
996       cost reaches a limit (specified by
997       <varname>vacuum_cost_limit</varname>), the process performing
998       the operation will sleep for a while (specified by
999       <varname>vacuum_cost_delay</varname>). Then it will reset the
1000       counter and continue execution.
1001      </para>
1002
1003      <para>
1004       The intent of this feature is to allow administrators to reduce
1005       the I/O impact of these commands on concurrent database
1006       activity. There are many situations in which it is not very
1007       important that maintenance commands like
1008       <command>VACUUM</command> and <command>ANALYZE</command> finish
1009       quickly; however, it is usually very important that these
1010       commands do not significantly interfere with the ability of the
1011       system to perform other database operations. Cost-based vacuum
1012       delay provides a way for administrators to achieve this.
1013      </para>
1014
1015      <para>
1016       This feature is disabled by default. To enable it, set the
1017       <varname>vacuum_cost_delay</varname> variable to a nonzero
1018       value.
1019      </para>
1020
1021      <variablelist>
1022       <varlistentry id="guc-vacuum-cost-delay" xreflabel="vacuum_cost_delay">
1023        <term><varname>vacuum_cost_delay</varname> (<type>integer</type>)</term>
1024        <indexterm>
1025         <primary><varname>vacuum_cost_delay</> configuration parameter</primary>
1026        </indexterm>
1027        <listitem>
1028         <para>
1029          The length of time, in milliseconds, that the process will sleep
1030          when the cost limit has been exceeded.
1031          The default value is 0, which disables the cost-based vacuum
1032          delay feature.  Positive values enable cost-based vacuuming.
1033          Note that on many systems, the effective resolution
1034          of sleep delays is 10 milliseconds; setting
1035          <varname>vacuum_cost_delay</varname> to a value that is
1036          not a multiple of 10 may have the same results as setting it
1037          to the next higher multiple of 10.
1038         </para>
1039        </listitem>
1040       </varlistentry>
1041
1042       <varlistentry id="guc-vacuum-cost-page-hit" xreflabel="vacuum_cost_page_hit">
1043        <term><varname>vacuum_cost_page_hit</varname> (<type>integer</type>)</term>
1044        <indexterm>
1045         <primary><varname>vacuum_cost_page_hit</> configuration parameter</primary>
1046        </indexterm>
1047        <listitem>
1048         <para>
1049          The estimated cost for vacuuming a buffer found in the shared buffer
1050          cache. It represents the cost to lock the buffer pool, lookup
1051          the shared hash table and scan the content of the page. The
1052          default value is 1.
1053         </para>
1054        </listitem>
1055       </varlistentry>
1056
1057       <varlistentry id="guc-vacuum-cost-page-miss" xreflabel="vacuum_cost_page_miss">
1058        <term><varname>vacuum_cost_page_miss</varname> (<type>integer</type>)</term>
1059        <indexterm>
1060         <primary><varname>vacuum_cost_page_miss</> configuration parameter</primary>
1061        </indexterm>
1062        <listitem>
1063         <para>
1064          The estimated cost for vacuuming a buffer that has to be read from
1065          disk.  This represents the effort to lock the buffer pool,
1066          lookup the shared hash table, read the desired block in from
1067          the disk and scan its content. The default value is 10.
1068         </para>
1069        </listitem>
1070       </varlistentry>
1071
1072       <varlistentry id="guc-vacuum-cost-page-dirty" xreflabel="vacuum_cost_page_dirty">
1073        <term><varname>vacuum_cost_page_dirty</varname> (<type>integer</type>)</term>
1074        <indexterm>
1075         <primary><varname>vacuum_cost_page_dirty</> configuration parameter</primary>
1076        </indexterm>
1077        <listitem>
1078         <para>
1079          The estimated cost charged when vacuum modifies a block that was
1080          previously clean. It represents the extra I/O required to
1081          flush the dirty block out to disk again. The default value is
1082          20.
1083         </para>
1084        </listitem>
1085       </varlistentry>
1086
1087       <varlistentry id="guc-vacuum-cost-limit" xreflabel="vacuum_cost_limit">
1088        <term><varname>vacuum_cost_limit</varname> (<type>integer</type>)</term>
1089        <indexterm>
1090         <primary><varname>vacuum_cost_limit</> configuration parameter</primary>
1091        </indexterm>
1092        <listitem>
1093         <para>
1094          The accumulated cost that will cause the vacuuming process to sleep.
1095          The default value is 200.
1096         </para>
1097        </listitem>
1098       </varlistentry>
1099      </variablelist>
1100
1101      <note>
1102       <para>
1103        There are certain operations that hold critical locks and should
1104        therefore complete as quickly as possible.  Cost-based vacuum
1105        delays do not occur during such operations.  Therefore it is
1106        possible that the cost accumulates far higher than the specified
1107        limit.  To avoid uselessly long delays in such cases, the actual
1108        delay is calculated as <varname>vacuum_cost_delay</varname> *
1109        <varname>accumulated_balance</varname> /
1110        <varname>vacuum_cost_limit</varname> with a maximum of
1111        <varname>vacuum_cost_delay</varname> * 4.
1112       </para>
1113      </note>
1114     </sect2>
1115
1116     <sect2 id="runtime-config-resource-background-writer">
1117      <title>Background Writer</title>
1118
1119      <para>
1120       Beginning in <productname>PostgreSQL</> 8.0, there is a separate server
1121       process called the <firstterm>background writer</>, whose sole function
1122       is to issue writes of <quote>dirty</> shared buffers.  The intent is
1123       that server processes handling user queries should seldom or never have
1124       to wait for a write to occur, because the background writer will do it.
1125       This arrangement also reduces the performance penalty associated with
1126       checkpoints.  The background writer will continuously trickle out dirty
1127       pages to disk, so that only a few pages will need to be forced out when
1128       checkpoint time arrives, instead of the storm of dirty-buffer writes that
1129       formerly occurred at each checkpoint.  However there is a net overall
1130       increase in I/O load, because where a repeatedly-dirtied page might
1131       before have been written only once per checkpoint interval, the
1132       background writer might write it several times in the same interval.
1133       In most situations a continuous low load is preferable to periodic
1134       spikes, but the parameters discussed in this subsection can be used to tune
1135       the behavior for local needs.
1136      </para>
1137
1138      <variablelist>
1139       <varlistentry id="guc-bgwriter-delay" xreflabel="bgwriter_delay">
1140        <term><varname>bgwriter_delay</varname> (<type>integer</type>)</term>
1141        <indexterm>
1142         <primary><varname>bgwriter_delay</> configuration parameter</primary>
1143        </indexterm>
1144        <listitem>
1145         <para>
1146          Specifies the delay between activity rounds for the
1147          background writer.  In each round the writer issues writes
1148          for some number of dirty buffers (controllable by the
1149          following parameters).  It then sleeps for <varname>bgwriter_delay</>
1150          milliseconds, and repeats.  The default value is 200. Note
1151          that on many systems, the effective resolution of sleep
1152          delays is 10 milliseconds; setting <varname>bgwriter_delay</>
1153          to a value that is not a multiple of 10 may have the same
1154          results as setting it to the next higher multiple of 10.
1155          This parameter can only be set in the <filename>postgresql.conf</>
1156          file or on the server command line.
1157         </para>
1158        </listitem>
1159       </varlistentry>
1160
1161       <varlistentry id="guc-bgwriter-lru-percent" xreflabel="bgwriter_lru_percent">
1162        <term><varname>bgwriter_lru_percent</varname> (<type>floating point</type>)</term>
1163        <indexterm>
1164         <primary><varname>bgwriter_lru_percent</> configuration parameter</primary>
1165        </indexterm>
1166        <listitem>
1167         <para>
1168          To reduce the probability that server processes will need to issue
1169          their own writes, the background writer tries to write buffers that
1170          are likely to be recycled soon.  In each round, it examines up to
1171          <varname>bgwriter_lru_percent</> of the buffers that are nearest to
1172          being recycled, and writes any that are dirty.
1173          The default value is 1.0 (this is a percentage of the total number
1174          of shared buffers).
1175          This parameter can only be set in the <filename>postgresql.conf</>
1176          file or on the server command line.
1177         </para>
1178        </listitem>
1179       </varlistentry>
1180
1181       <varlistentry id="guc-bgwriter-lru-maxpages" xreflabel="bgwriter_lru_maxpages">
1182        <term><varname>bgwriter_lru_maxpages</varname> (<type>integer</type>)</term>
1183        <indexterm>
1184         <primary><varname>bgwriter_lru_maxpages</> configuration parameter</primary>
1185        </indexterm>
1186        <listitem>
1187         <para>
1188          In each round, no more than this many buffers will be written
1189          as a result of scanning soon-to-be-recycled buffers.
1190          The default value is 5.
1191          This parameter can only be set in the <filename>postgresql.conf</>
1192          file or on the server command line.
1193         </para>
1194        </listitem>
1195       </varlistentry>
1196
1197       <varlistentry id="guc-bgwriter-all-percent" xreflabel="bgwriter_all_percent">
1198        <term><varname>bgwriter_all_percent</varname> (<type>floating point</type>)</term>
1199        <indexterm>
1200         <primary><varname>bgwriter_all_percent</> configuration parameter</primary>
1201        </indexterm>
1202        <listitem>
1203         <para>
1204          To reduce the amount of work that will be needed at checkpoint time,
1205          the background writer also does a circular scan through the entire
1206          buffer pool, writing buffers that are found to be dirty.
1207          In each round, it examines up to
1208          <varname>bgwriter_all_percent</> of the buffers for this purpose.
1209          The default value is 0.333 (this is a percentage of the total number
1210          of shared buffers).  With the default <varname>bgwriter_delay</>
1211          setting, this will allow the entire shared buffer pool to be scanned
1212          about once per minute.
1213          This parameter can only be set in the <filename>postgresql.conf</>
1214          file or on the server command line.
1215         </para>
1216        </listitem>
1217       </varlistentry>
1218
1219       <varlistentry id="guc-bgwriter-all-maxpages" xreflabel="bgwriter_all_maxpages">
1220        <term><varname>bgwriter_all_maxpages</varname> (<type>integer</type>)</term>
1221        <indexterm>
1222         <primary><varname>bgwriter_all_maxpages</> configuration parameter</primary>
1223        </indexterm>
1224        <listitem>
1225         <para>
1226          In each round, no more than this many buffers will be written
1227          as a result of the scan of the entire buffer pool.  (If this
1228          limit is reached, the scan stops, and resumes at the next buffer
1229          during the next round.)
1230          The default value is 5.
1231          This parameter can only be set in the <filename>postgresql.conf</>
1232          file or on the server command line.
1233         </para>
1234        </listitem>
1235       </varlistentry>
1236      </variablelist>
1237
1238      <para>
1239       Smaller values of <varname>bgwriter_all_percent</varname> and
1240       <varname>bgwriter_all_maxpages</varname> reduce the extra I/O load
1241       caused by the background writer, but leave more work to be done
1242       at checkpoint time.  To reduce load spikes at checkpoints,
1243       increase these two values.
1244       Similarly, smaller values of <varname>bgwriter_lru_percent</varname> and
1245       <varname>bgwriter_lru_maxpages</varname> reduce the extra I/O load
1246       caused by the background writer, but make it more likely that server
1247       processes will have to issue writes for themselves, delaying interactive
1248       queries.
1249       To disable background writing entirely,
1250       set both <varname>maxpages</varname> values and/or both
1251       <varname>percent</varname> values to zero.
1252      </para>
1253     </sect2>
1254    </sect1>
1255
1256    <sect1 id="runtime-config-wal">
1257     <title>Write Ahead Log</title>
1258
1259    <para>
1260     See also <xref linkend="wal-configuration"> for details on WAL
1261     tuning.
1262    </para>
1263
1264     <sect2 id="runtime-config-wal-settings">
1265      <title>Settings</title>
1266      <variablelist>
1267      
1268      <varlistentry id="guc-fsync" xreflabel="fsync">
1269       <indexterm>
1270        <primary><varname>fsync</> configuration parameter</primary>
1271       </indexterm>
1272       <term><varname>fsync</varname> (<type>boolean</type>)</term>
1273       <listitem>
1274        <para>
1275         If this parameter is on, the <productname>PostgreSQL</> server
1276         will try to make sure that updates are physically written to
1277         disk, by issuing <function>fsync()</> system calls or various
1278         equivalent methods (see <xref linkend="guc-wal-sync-method">).
1279         This ensures that the database cluster can recover to a
1280         consistent state after an operating system or hardware crash.
1281        </para>
1282
1283        <para>
1284         However, using <varname>fsync</varname> results in a
1285         performance penalty: when a transaction is committed,
1286         <productname>PostgreSQL</productname> must wait for the
1287         operating system to flush the write-ahead log to disk.  When
1288         <varname>fsync</varname> is disabled, the operating system is
1289         allowed to do its best in buffering, ordering, and delaying
1290         writes. This can result in significantly improved performance.
1291         However, if the system crashes, the results of the last few
1292         committed transactions may be lost in part or whole. In the
1293         worst case, unrecoverable data corruption may occur.
1294         (Crashes of the database software itself are <emphasis>not</>
1295         a risk factor here.  Only an operating-system-level crash
1296         creates a risk of corruption.)
1297        </para>
1298
1299        <para>
1300         Due to the risks involved, there is no universally correct
1301         setting for <varname>fsync</varname>. Some administrators
1302         always disable <varname>fsync</varname>, while others only
1303         turn it off during initial bulk data loads, where there is a clear
1304         restart point if something goes wrong.  Others
1305         always leave <varname>fsync</varname> enabled. The default is
1306         to enable <varname>fsync</varname>, for maximum reliability.
1307         If you trust your operating system, your hardware, and your
1308         utility company (or your battery backup), you can consider
1309         disabling <varname>fsync</varname>.
1310        </para>
1311
1312        <para>
1313         This parameter can only be set in the <filename>postgresql.conf</>
1314         file or on the server command line.
1315         If you turn this parameter off, also consider turning off 
1316         <xref linkend="guc-full-page-writes">.
1317        </para>
1318       </listitem>
1319      </varlistentry>
1320      
1321      <varlistentry id="guc-wal-sync-method" xreflabel="wal_sync_method">
1322       <term><varname>wal_sync_method</varname> (<type>string</type>)</term>
1323       <indexterm>
1324        <primary><varname>wal_sync_method</> configuration parameter</primary>
1325       </indexterm>
1326       <listitem>
1327        <para>
1328         Method used for forcing WAL updates out to disk.
1329         If <varname>fsync</varname> is off then this setting is irrelevant,
1330         since updates will not be forced out at all.
1331         Possible values are:
1332        </para>
1333        <itemizedlist>
1334         <listitem>
1335         <para>
1336          <literal>open_datasync</> (write WAL files with <function>open()</> option <symbol>O_DSYNC</>)
1337         </para>
1338         </listitem>
1339         <listitem>
1340         <para>
1341          <literal>fdatasync</> (call <function>fdatasync()</> at each commit)
1342         </para>
1343         </listitem>
1344         <listitem>
1345         <para>
1346          <literal>fsync_writethrough</> (call <function>fsync()</> at each commit, forcing write-through of any disk write cache)
1347         </para>
1348         </listitem>
1349         <listitem>
1350         <para>
1351          <literal>fsync</> (call <function>fsync()</> at each commit)
1352         </para>
1353         </listitem>
1354         <listitem>
1355         <para>
1356          <literal>open_sync</> (write WAL files with <function>open()</> option <symbol>O_SYNC</>)
1357         </para>
1358         </listitem>
1359        </itemizedlist>
1360        <para>
1361         Not all of these choices are available on all platforms.
1362         The default is the first method in the above list that is supported
1363         by the platform.
1364         This parameter can only be set in the <filename>postgresql.conf</>
1365         file or on the server command line.
1366        </para>
1367       </listitem>
1368      </varlistentry>
1369      
1370      <varlistentry id="guc-full-page-writes" xreflabel="full_page_writes">
1371       <indexterm>
1372        <primary><varname>full_page_writes</> configuration parameter</primary>
1373       </indexterm>
1374       <term><varname>full_page_writes</varname> (<type>boolean</type>)</term>
1375       <listitem>
1376        <para>
1377         When this parameter is on, the <productname>PostgreSQL</> server
1378         writes the entire content of each disk page to WAL during the
1379         first modification of that page after a checkpoint.
1380         This is needed because
1381         a page write that is in process during an operating system crash might
1382         be only partially completed, leading to an on-disk page
1383         that contains a mix of old and new data.  The row-level change data
1384         normally stored in WAL will not be enough to completely restore
1385         such a page during post-crash recovery.  Storing the full page image
1386         guarantees that the page can be correctly restored, but at a price
1387         in increasing the amount of data that must be written to WAL.
1388         (Because WAL replay always starts from a checkpoint, it is sufficient
1389         to do this during the first change of each page after a checkpoint.
1390         Therefore, one way to reduce the cost of full-page writes is to
1391         increase the checkpoint interval parameters.)
1392        </para>
1393
1394        <para>
1395         Turning this parameter off speeds normal operation, but
1396         might lead to a corrupt database after an operating system crash
1397         or power failure. The risks are similar to turning off
1398         <varname>fsync</>, though smaller.  It may be safe to turn off
1399         this parameter if you have hardware (such as a battery-backed disk
1400         controller) or filesystem software (e.g., Reiser4) that reduces
1401         the risk of partial page writes to an acceptably low level.
1402        </para>
1403
1404        <para>
1405         Turning off this parameter does not affect use of
1406         WAL archiving for point-in-time recovery (PITR)
1407         (see <xref linkend="continuous-archiving">).
1408        </para>
1409
1410        <para>
1411         This parameter can only be set in the <filename>postgresql.conf</>
1412         file or on the server command line.
1413         The default is <literal>on</>.
1414        </para>
1415       </listitem>
1416      </varlistentry>
1417      
1418      <varlistentry id="guc-wal-buffers" xreflabel="wal_buffers">
1419       <term><varname>wal_buffers</varname> (<type>integer</type>)</term>
1420       <indexterm>
1421        <primary><varname>wal_buffers</> configuration parameter</primary>
1422       </indexterm>
1423       <listitem>
1424        <para>
1425         Number of disk-page buffers allocated in shared memory for WAL data.
1426         The default is 8.  The setting need only be large enough to hold
1427         the amount of WAL data generated by one typical transaction, since
1428         the data is written out to disk at every transaction commit.
1429         This parameter can only be set at server start.
1430        </para>
1431
1432        <para>
1433         Increasing this parameter may cause <productname>PostgreSQL</>
1434         to request more <systemitem class="osname">System V</> shared
1435         memory than your operating system's default configuration
1436         allows. See <xref linkend="sysvipc"> for information on how to
1437         adjust those parameters, if necessary.
1438        </para>
1439       </listitem>
1440      </varlistentry>
1441                 
1442      <varlistentry id="guc-commit-delay" xreflabel="commit_delay">
1443       <term><varname>commit_delay</varname> (<type>integer</type>)</term>
1444       <indexterm>
1445        <primary><varname>commit_delay</> configuration parameter</primary>
1446       </indexterm>
1447       <listitem>
1448        <para>
1449         Time delay between writing a commit record to the WAL buffer
1450         and flushing the buffer out to disk, in microseconds. A
1451         nonzero delay can allow multiple transactions to be committed
1452         with only one <function>fsync()</function> system call, if
1453         system load is high enough that additional transactions become
1454         ready to commit within the given interval. But the delay is
1455         just wasted if no other transactions become ready to
1456         commit. Therefore, the delay is only performed if at least
1457         <varname>commit_siblings</varname> other transactions are
1458         active at the instant that a server process has written its
1459         commit record. The default is zero (no delay).
1460        </para>
1461       </listitem>
1462      </varlistentry>
1463
1464      <varlistentry id="guc-commit-siblings" xreflabel="commit_siblings">
1465       <term><varname>commit_siblings</varname> (<type>integer</type>)</term>
1466       <indexterm>
1467        <primary><varname>commit_siblings</> configuration parameter</primary>
1468       </indexterm>
1469       <listitem>
1470        <para>
1471         Minimum number of concurrent open transactions to require
1472         before performing the <varname>commit_delay</> delay. A larger
1473         value makes it more probable that at least one other
1474         transaction will become ready to commit during the delay
1475         interval. The default is five.
1476        </para>
1477       </listitem>
1478      </varlistentry>
1479
1480      </variablelist>
1481      </sect2>
1482      <sect2 id="runtime-config-wal-checkpoints">
1483      <title>Checkpoints</title>
1484
1485     <variablelist>
1486      <varlistentry id="guc-checkpoint-segments" xreflabel="checkpoint_segments">
1487       <term><varname>checkpoint_segments</varname> (<type>integer</type>)</term>
1488       <indexterm>
1489        <primary><varname>checkpoint_segments</> configuration parameter</primary>
1490       </indexterm>
1491       <listitem>
1492        <para>
1493         Maximum distance between automatic WAL checkpoints, in log
1494         file segments (each segment is normally 16 megabytes). The
1495         default is three.
1496         This parameter can only be set in the <filename>postgresql.conf</>
1497         file or on the server command line.
1498        </para>
1499       </listitem>
1500      </varlistentry>
1501
1502      <varlistentry id="guc-checkpoint-timeout" xreflabel="checkpoint_timeout">
1503       <term><varname>checkpoint_timeout</varname> (<type>integer</type>)</term>
1504       <indexterm>
1505        <primary><varname>checkpoint_timeout</> configuration parameter</primary>
1506       </indexterm>
1507       <listitem>
1508        <para>
1509         Maximum time between automatic WAL checkpoints, in
1510         seconds. The default is 300 seconds.
1511         This parameter can only be set in the <filename>postgresql.conf</>
1512         file or on the server command line.
1513        </para>
1514       </listitem>
1515      </varlistentry>
1516
1517      <varlistentry id="guc-checkpoint-warning" xreflabel="checkpoint_warning">
1518       <term><varname>checkpoint_warning</varname> (<type>integer</type>)</term>
1519       <indexterm>
1520        <primary><varname>checkpoint_warning</> configuration parameter</primary>
1521       </indexterm>
1522       <listitem>
1523        <para>
1524         Write a message to the server log if checkpoints caused by
1525         the filling of checkpoint segment files happen closer together
1526         than this many seconds (which suggests that
1527         <varname>checkpoint_segments</> ought to be raised).  The default is
1528         30 seconds.  Zero disables the warning.
1529         This parameter can only be set in the <filename>postgresql.conf</>
1530         file or on the server command line.
1531        </para>
1532       </listitem>
1533      </varlistentry>
1534
1535      </variablelist>
1536      </sect2>
1537      <sect2 id="runtime-config-wal-archiving">
1538      <title>Archiving</title>
1539
1540     <variablelist>
1541      <varlistentry id="guc-archive-command" xreflabel="archive_command">
1542       <term><varname>archive_command</varname> (<type>string</type>)</term>
1543       <indexterm>
1544        <primary><varname>archive_command</> configuration parameter</primary>
1545       </indexterm>
1546       <listitem>
1547        <para>
1548         The shell command to execute to archive a completed segment of
1549         the WAL file series. If this is an empty string (the default),
1550         WAL archiving is disabled. Any <literal>%p</> in the string is
1551         replaced by the absolute path of the file to archive, and any
1552         <literal>%f</> is replaced by the file name only. Use
1553         <literal>%%</> to embed an actual <literal>%</> character in the
1554         command. For more information see <xref
1555         linkend="backup-archiving-wal">.
1556         This parameter can only be set in the <filename>postgresql.conf</>
1557         file or on the server command line.
1558        </para>
1559        <para>
1560         It is important for the command to return a zero exit status if
1561         and only if it succeeds.  Examples:
1562 <programlisting>
1563 archive_command = 'cp "%p" /mnt/server/archivedir/"%f"'
1564 archive_command = 'copy "%p" /mnt/server/archivedir/"%f"'  # Windows
1565 </programlisting>
1566        </para>
1567       </listitem>
1568      </varlistentry>
1569      
1570      </variablelist>
1571     </sect2>
1572    </sect1>
1573
1574    <sect1 id="runtime-config-query">
1575     <title>Query Planning</title>
1576
1577     <sect2 id="runtime-config-query-enable">
1578      <title>Planner Method Configuration</title>
1579
1580       <para>
1581        These configuration parameters provide a crude method of
1582        influencing the query plans chosen by the query optimizer. If
1583        the default plan chosen by the optimizer for a particular query
1584        is not optimal, a temporary solution may be found by using one
1585        of these configuration parameters to force the optimizer to
1586        choose a different plan.  Turning one of these settings off
1587        permanently is seldom a good idea, however.
1588        Better ways to improve the quality of the
1589        plans chosen by the optimizer include adjusting the <xref
1590        linkend="runtime-config-query-constants"
1591        endterm="runtime-config-query-constants-title">, running <xref
1592        linkend="sql-analyze" endterm="sql-analyze-title"> more
1593        frequently, increasing the value of the <xref
1594        linkend="guc-default-statistics-target"> configuration parameter,
1595        and increasing the amount of statistics collected for
1596        specific columns using <command>ALTER TABLE SET
1597        STATISTICS</command>.
1598       </para>
1599
1600      <variablelist>
1601      <varlistentry id="guc-enable-bitmapscan" xreflabel="enable_bitmapscan">
1602       <term><varname>enable_bitmapscan</varname> (<type>boolean</type>)</term>
1603       <indexterm>
1604        <primary>bitmap scan</primary>
1605       </indexterm>
1606       <indexterm>
1607        <primary><varname>enable_bitmapscan</> configuration parameter</primary>
1608       </indexterm>
1609       <listitem>
1610        <para>
1611         Enables or disables the query planner's use of bitmap-scan plan
1612         types. The default is <literal>on</>.
1613        </para>
1614       </listitem>
1615      </varlistentry>
1616
1617      <varlistentry id="guc-enable-hashagg" xreflabel="enable_hashagg">
1618       <term><varname>enable_hashagg</varname> (<type>boolean</type>)</term>
1619       <indexterm>
1620        <primary><varname>enable_hashagg</> configuration parameter</primary>
1621       </indexterm>
1622       <listitem>
1623        <para>
1624         Enables or disables the query planner's use of hashed
1625         aggregation plan types. The default is <literal>on</>.
1626        </para>
1627       </listitem>
1628      </varlistentry>
1629
1630      <varlistentry id="guc-enable-hashjoin" xreflabel="enable_hashjoin">
1631       <term><varname>enable_hashjoin</varname> (<type>boolean</type>)</term>
1632       <indexterm>
1633        <primary><varname>enable_hashjoin</> configuration parameter</primary>
1634       </indexterm>
1635       <listitem>
1636        <para>
1637         Enables or disables the query planner's use of hash-join plan
1638         types. The default is <literal>on</>.
1639        </para>
1640       </listitem>
1641      </varlistentry>
1642
1643      <varlistentry id="guc-enable-indexscan" xreflabel="enable_indexscan">
1644       <term><varname>enable_indexscan</varname> (<type>boolean</type>)</term>
1645       <indexterm>
1646        <primary>index scan</primary>
1647       </indexterm>
1648       <indexterm>
1649        <primary><varname>enable_indexscan</> configuration parameter</primary>
1650       </indexterm>
1651       <listitem>
1652        <para>
1653         Enables or disables the query planner's use of index-scan plan
1654         types. The default is <literal>on</>.
1655        </para>
1656       </listitem>
1657      </varlistentry>
1658
1659      <varlistentry id="guc-enable-mergejoin" xreflabel="enable_mergejoin">
1660       <term><varname>enable_mergejoin</varname> (<type>boolean</type>)</term>
1661       <indexterm>
1662        <primary><varname>enable_mergejoin</> configuration parameter</primary>
1663       </indexterm>
1664       <listitem>
1665        <para>
1666         Enables or disables the query planner's use of merge-join plan
1667         types. The default is <literal>on</>.
1668        </para>
1669       </listitem>
1670      </varlistentry>
1671
1672      <varlistentry id="guc-enable-nestloop" xreflabel="enable_nestloop">
1673       <term><varname>enable_nestloop</varname> (<type>boolean</type>)</term>
1674       <indexterm>
1675        <primary><varname>enable_nestloop</> configuration parameter</primary>
1676       </indexterm>
1677       <listitem>
1678        <para>
1679         Enables or disables the query planner's use of nested-loop join
1680         plans. It's not possible to suppress nested-loop joins entirely,
1681         but turning this variable off discourages the planner from using
1682         one if there are other methods available. The default is
1683         <literal>on</>.
1684        </para>
1685       </listitem>
1686      </varlistentry>
1687
1688      <varlistentry id="guc-enable-seqscan" xreflabel="enable_seqscan">
1689       <term><varname>enable_seqscan</varname> (<type>boolean</type>)</term>
1690       <indexterm>
1691        <primary>sequential scan</primary>
1692       </indexterm>
1693       <indexterm>
1694        <primary><varname>enable_seqscan</> configuration parameter</primary>
1695       </indexterm>
1696       <listitem>
1697        <para>
1698         Enables or disables the query planner's use of sequential scan
1699         plan types. It's not possible to suppress sequential scans
1700         entirely, but turning this variable off discourages the planner
1701         from using one if there are other methods available. The
1702         default is <literal>on</>.
1703        </para>
1704       </listitem>
1705      </varlistentry>
1706
1707      <varlistentry id="guc-enable-sort" xreflabel="enable_sort">
1708       <term><varname>enable_sort</varname> (<type>boolean</type>)</term>
1709       <indexterm>
1710        <primary><varname>enable_sort</> configuration parameter</primary>
1711       </indexterm>
1712       <listitem>
1713        <para>
1714         Enables or disables the query planner's use of explicit sort
1715         steps. It's not possible to suppress explicit sorts entirely,
1716         but turning this variable off discourages the planner from
1717         using one if there are other methods available. The default
1718         is <literal>on</>.
1719        </para>
1720       </listitem>
1721      </varlistentry>
1722
1723      <varlistentry id="guc-enable-tidscan" xreflabel="enable_tidscan">
1724       <term><varname>enable_tidscan</varname> (<type>boolean</type>)</term>
1725       <indexterm>
1726        <primary><varname>enable_tidscan</> configuration parameter</primary>
1727       </indexterm>
1728       <listitem>
1729        <para>
1730         Enables or disables the query planner's use of <acronym>TID</>
1731         scan plan types. The default is <literal>on</>.
1732        </para>
1733       </listitem>
1734      </varlistentry>
1735      
1736      </variablelist>
1737      </sect2>
1738      <sect2 id="runtime-config-query-constants">
1739      <title id="runtime-config-query-constants-title">
1740       Planner Cost Constants
1741      </title>
1742
1743    <note>
1744     <para>
1745      Unfortunately, there is no well-defined method for determining
1746      ideal values for the family of <quote>cost</quote> variables that
1747      appear below. You are encouraged to experiment and share
1748      your findings.
1749     </para>
1750    </note>
1751
1752      <variablelist>
1753      
1754      <varlistentry id="guc-effective-cache-size" xreflabel="effective_cache_size">
1755       <term><varname>effective_cache_size</varname> (<type>floating point</type>)</term>
1756       <indexterm>
1757        <primary><varname>effective_cache_size</> configuration parameter</primary>
1758       </indexterm>
1759       <listitem>
1760        <para>
1761         Sets the planner's assumption about the effective size of the
1762         disk cache that is available to a single index scan.  This is
1763         factored into estimates of the cost of using an index; a
1764         higher value makes it more likely index scans will be used, a
1765         lower value makes it more likely sequential scans will be
1766         used. When setting this parameter you should consider both
1767         <productname>PostgreSQL</productname>'s shared buffers and the
1768         portion of the kernel's disk cache that will be used for
1769         <productname>PostgreSQL</productname> data files.  Also, take
1770         into account the expected number of concurrent queries using
1771         different indexes, since they will have to share the available
1772         space.  This parameter has no effect on the size of shared
1773         memory allocated by <productname>PostgreSQL</productname>, nor
1774         does it reserve kernel disk cache; it is used only for
1775         estimation purposes.  The value is measured in disk pages,
1776         which are normally 8192 bytes each. The default is 1000.
1777        </para>
1778       </listitem>
1779      </varlistentry>
1780
1781      <varlistentry id="guc-random-page-cost" xreflabel="random_page_cost">
1782       <term><varname>random_page_cost</varname> (<type>floating point</type>)</term>
1783       <indexterm>
1784        <primary><varname>random_page_cost</> configuration parameter</primary>
1785       </indexterm>
1786       <listitem>
1787        <para>
1788         Sets the planner's estimate of the cost of a
1789         nonsequentially fetched disk page. This is measured as a
1790         multiple of the cost of a sequential page fetch. A higher
1791         value makes it more likely a sequential scan will be used, a
1792         lower value makes it more likely an index scan will be
1793         used. The default is four.
1794        </para>
1795       </listitem>
1796      </varlistentry>
1797
1798      <varlistentry id="guc-cpu-tuple-cost" xreflabel="cpu_tuple_cost">
1799       <term><varname>cpu_tuple_cost</varname> (<type>floating point</type>)</term>
1800       <indexterm>
1801        <primary><varname>cpu_tuple_cost</> configuration parameter</primary>
1802       </indexterm>
1803       <listitem>
1804        <para>
1805         Sets the planner's estimate of the cost of processing
1806         each row during a query. This is measured as a fraction of
1807         the cost of a sequential page fetch. The default is 0.01.
1808        </para>
1809       </listitem>
1810      </varlistentry>
1811
1812      <varlistentry id="guc-cpu-index-tuple-cost" xreflabel="cpu_index_tuple_cost">
1813       <term><varname>cpu_index_tuple_cost</varname> (<type>floating point</type>)</term>
1814       <indexterm>
1815        <primary><varname>cpu_index_tuple_cost</> configuration parameter</primary>
1816       </indexterm>
1817       <listitem>
1818        <para>
1819         Sets the planner's estimate of the cost of processing
1820         each index row during an index scan. This is measured as a
1821         fraction of the cost of a sequential page fetch. The default
1822         is 0.001.
1823        </para>
1824       </listitem>
1825      </varlistentry>
1826     
1827      <varlistentry id="guc-cpu-operator-cost" xreflabel="cpu_operator_cost">
1828       <term><varname>cpu_operator_cost</varname> (<type>floating point</type>)</term>
1829       <indexterm>
1830        <primary><varname>cpu_operator_cost</> configuration parameter</primary>
1831       </indexterm>
1832       <listitem>
1833        <para>
1834         Sets the planner's estimate of the cost of processing each
1835         operator in a <literal>WHERE</> clause. This is measured as a fraction of
1836         the cost of a sequential page fetch. The default is 0.0025.
1837        </para>
1838       </listitem>
1839      </varlistentry>
1840
1841      </variablelist>
1842
1843     </sect2>
1844      <sect2 id="runtime-config-query-geqo">
1845      <title>Genetic Query Optimizer</title>
1846
1847      <variablelist>
1848
1849      <varlistentry id="guc-geqo" xreflabel="geqo">
1850       <indexterm>
1851        <primary>genetic query optimization</primary>
1852       </indexterm>
1853       <indexterm>
1854        <primary>GEQO</primary>
1855        <see>genetic query optimization</see>
1856       </indexterm>
1857       <indexterm>
1858        <primary><varname>geqo</> configuration parameter</primary>
1859       </indexterm>
1860       <term><varname>geqo</varname> (<type>boolean</type>)</term>
1861       <listitem>
1862        <para>
1863         Enables or disables genetic query optimization, which is an
1864         algorithm that attempts to do query planning without
1865         exhaustive searching. This is on by default. The
1866         <varname>geqo_threshold</varname> variable provides a more
1867         granular way to disable GEQO for certain classes of queries.
1868        </para>
1869       </listitem>
1870      </varlistentry>
1871
1872      <varlistentry id="guc-geqo-threshold" xreflabel="geqo_threshold">
1873       <term><varname>geqo_threshold</varname> (<type>integer</type>)</term>
1874       <indexterm>
1875        <primary><varname>geqo_threshold</> configuration parameter</primary>
1876       </indexterm>
1877       <listitem>
1878        <para>
1879         Use genetic query optimization to plan queries with at least
1880         this many <literal>FROM</> items involved. (Note that a
1881         <literal>FULL OUTER JOIN</> construct counts as only one <literal>FROM</>
1882         item.) The default is 12. For simpler queries it is usually best
1883         to use the deterministic, exhaustive planner, but for queries with
1884         many tables the deterministic planner takes too long.
1885        </para>
1886       </listitem>
1887      </varlistentry>
1888
1889      <varlistentry id="guc-geqo-effort" xreflabel="geqo_effort">
1890       <term><varname>geqo_effort</varname>
1891       (<type>integer</type>)</term>
1892       <indexterm>
1893        <primary><varname>geqo_effort</> configuration parameter</primary>
1894       </indexterm>
1895       <listitem>
1896        <para>
1897         Controls the trade off between planning time and query plan
1898         efficiency in GEQO. This variable must be an integer in the
1899         range from 1 to 10. The default value is 5. Larger values
1900         increase the time spent doing query planning, but also
1901         increase the likelihood that an efficient query plan will be
1902         chosen.
1903        </para>
1904
1905        <para>
1906         <varname>geqo_effort</varname> doesn't actually do anything
1907         directly; it is only used to compute the default values for
1908         the other variables that influence GEQO behavior (described
1909         below). If you prefer, you can set the other parameters by
1910         hand instead.
1911        </para>
1912       </listitem>
1913      </varlistentry>
1914
1915      <varlistentry id="guc-geqo-pool-size" xreflabel="geqo_pool_size">
1916       <term><varname>geqo_pool_size</varname> (<type>integer</type>)</term>
1917       <indexterm>
1918        <primary><varname>geqo_pool_size</> configuration parameter</primary>
1919       </indexterm>
1920       <listitem>
1921        <para>
1922         Controls the pool size used by GEQO. The pool size is the
1923         number of individuals in the genetic population.  It must be
1924         at least two, and useful values are typically 100 to 1000.  If
1925         it is set to zero (the default setting) then a suitable
1926         default is chosen based on <varname>geqo_effort</varname> and
1927         the number of tables in the query.
1928        </para>
1929       </listitem>
1930      </varlistentry>
1931
1932      <varlistentry id="guc-geqo-generations" xreflabel="geqo_generations">
1933       <term><varname>geqo_generations</varname> (<type>integer</type>)</term>
1934       <indexterm>
1935        <primary><varname>geqo_generations</> configuration parameter</primary>
1936       </indexterm>
1937       <listitem>
1938        <para>
1939         Controls the number of generations used by GEQO.  Generations
1940         specifies the number of iterations of the algorithm.  It must
1941         be at least one, and useful values are in the same range as
1942         the pool size.  If it is set to zero (the default setting)
1943         then a suitable default is chosen based on
1944         <varname>geqo_pool_size</varname>.
1945        </para>
1946       </listitem>
1947      </varlistentry>
1948
1949      <varlistentry id="guc-geqo-selection-bias" xreflabel="geqo_selection_bias">
1950       <term><varname>geqo_selection_bias</varname> (<type>floating point</type>)</term>
1951       <indexterm>
1952        <primary><varname>geqo_selection_bias</> configuration parameter</primary>
1953       </indexterm>
1954       <listitem>
1955        <para>
1956         Controls the selection bias used by GEQO. The selection bias
1957         is the selective pressure within the population. Values can be
1958         from 1.50 to 2.00; the latter is the default.
1959        </para>
1960       </listitem>
1961      </varlistentry>
1962      
1963      </variablelist>
1964     </sect2>
1965      <sect2 id="runtime-config-query-other">
1966      <title>Other Planner Options</title>
1967
1968      <variablelist>
1969
1970      <varlistentry id="guc-default-statistics-target" xreflabel="default_statistics_target">
1971       <term><varname>default_statistics_target</varname> (<type>integer</type>)</term>
1972       <indexterm>
1973        <primary><varname>default_statistics_target</> configuration parameter</primary>
1974       </indexterm>
1975       <listitem>
1976        <para>
1977         Sets the default statistics target for table columns that have
1978         not had a column-specific target set via <command>ALTER TABLE
1979         SET STATISTICS</>.  Larger values increase the time needed to
1980         do <command>ANALYZE</>, but may improve the quality of the
1981         planner's estimates. The default is 10. For more information
1982         on the use of statistics by the <productname>PostgreSQL</>
1983         query planner, refer to <xref linkend="planner-stats">.
1984        </para>
1985       </listitem>
1986      </varlistentry>
1987
1988      <varlistentry id="guc-constraint-exclusion" xreflabel="constraint_exclusion">
1989       <term><varname>constraint_exclusion</varname> (<type>boolean</type>)</term>
1990       <indexterm>
1991        <primary>constraint exclusion</primary>
1992       </indexterm>
1993       <indexterm>
1994        <primary><varname>constraint_exclusion</> configuration parameter</primary>
1995       </indexterm>
1996       <listitem>
1997        <para>
1998         Enables or disables the query planner's use of table constraints to
1999         optimize queries.  The default is <literal>off</>.
2000        </para>
2001
2002        <para>
2003         When this parameter is <literal>on</>, the planner compares
2004         query conditions with table <literal>CHECK</> constraints, and
2005         omits scanning tables for which the conditions contradict the
2006         constraints.  For example:
2007
2008 <programlisting>
2009 CREATE TABLE parent(key integer, ...);
2010 CREATE TABLE child1000(check (key between 1000 and 1999)) INHERITS(parent);
2011 CREATE TABLE child2000(check (key between 2000 and 2999)) INHERITS(parent);
2012 ...
2013 SELECT * FROM parent WHERE key = 2400;
2014 </programlisting>
2015
2016         With constraint exclusion enabled, this <command>SELECT</>
2017         will not scan <structname>child1000</> at all.  This can
2018         improve performance when inheritance is used to build
2019         partitioned tables.
2020        </para>
2021
2022        <para>
2023         Currently, <varname>constraint_exclusion</> is disabled by
2024         default because it risks incorrect results if query plans are
2025         cached &mdash; if a table constraint is changed or dropped,
2026         the previously generated plan might now be wrong, and there is
2027         no built-in mechanism to force re-planning.  (This deficiency
2028         will probably be addressed in a future
2029         <productname>PostgreSQL</> release.)  Another reason for
2030         keeping it off is that the constraint checks are relatively
2031         expensive, and in many circumstances will yield no savings.
2032         It is recommended to turn this on only if you are actually
2033         using partitioned tables designed to take advantage of the
2034         feature.
2035        </para>
2036
2037        <para>
2038         Refer to <xref linkend="ddl-partitioning"> for more information
2039         on using constraint exclusion and partitioning.
2040        </para>
2041       </listitem>
2042      </varlistentry>
2043
2044      <varlistentry id="guc-from-collapse-limit" xreflabel="from_collapse_limit">
2045       <term><varname>from_collapse_limit</varname> (<type>integer</type>)</term>
2046       <indexterm>
2047        <primary><varname>from_collapse_limit</> configuration parameter</primary>
2048       </indexterm>
2049       <listitem>
2050        <para>
2051         The planner will merge sub-queries into upper queries if the
2052         resulting <literal>FROM</literal> list would have no more than
2053         this many items.  Smaller values reduce planning time but may
2054         yield inferior query plans.  The default is 8.  It is usually
2055         wise to keep this less than <xref linkend="guc-geqo-threshold">.
2056         For more information see <xref linkend="explicit-joins">.
2057        </para>
2058       </listitem>
2059      </varlistentry>
2060
2061      <varlistentry id="guc-join-collapse-limit" xreflabel="join_collapse_limit">
2062       <term><varname>join_collapse_limit</varname> (<type>integer</type>)</term>
2063       <indexterm>
2064        <primary><varname>join_collapse_limit</> configuration parameter</primary>
2065       </indexterm>
2066       <listitem>
2067        <para>
2068         The planner will rewrite explicit <literal>JOIN</>
2069         constructs (except <literal>FULL JOIN</>s) into lists of
2070         <literal>FROM</> items whenever a list of no more than this many items
2071         would result.  Smaller values reduce planning time but may
2072         yield inferior query plans.
2073        </para>
2074
2075        <para>
2076         By default, this variable is set the same as
2077         <varname>from_collapse_limit</varname>, which is appropriate
2078         for most uses. Setting it to 1 prevents any reordering of
2079         explicit <literal>JOIN</>s. Thus, the explicit join order
2080         specified in the query will be the actual order in which the
2081         relations are joined. The query planner does not always choose
2082         the optimal join order; advanced users may elect to
2083         temporarily set this variable to 1, and then specify the join
2084         order they desire explicitly.
2085         For more information see <xref linkend="explicit-joins">.
2086        </para>
2087       </listitem>
2088      </varlistentry>
2089      
2090      </variablelist>
2091     </sect2>
2092    </sect1>
2093
2094    <sect1 id="runtime-config-logging">
2095     <title>Error Reporting and Logging</title>
2096
2097     <indexterm zone="runtime-config-logging">
2098      <primary>server log</primary>
2099     </indexterm>
2100
2101     <sect2 id="runtime-config-logging-where">
2102      <title>Where To Log</title>
2103
2104      <indexterm zone="runtime-config-logging-where">
2105       <primary>where to log</primary>
2106      </indexterm>
2107
2108      <variablelist>
2109
2110      <varlistentry id="guc-log-destination" xreflabel="log_destination">
2111       <term><varname>log_destination</varname> (<type>string</type>)</term>
2112       <indexterm>
2113        <primary><varname>log_destination</> configuration parameter</primary>
2114       </indexterm>
2115       <listitem>
2116        <para>
2117         <productname>PostgreSQL</productname> supports several methods
2118          for logging server messages, including
2119          <systemitem>stderr</systemitem> and
2120          <systemitem>syslog</systemitem>. On Windows, 
2121          <systemitem>eventlog</systemitem> is also supported. Set this
2122          parameter to a list of desired log destinations separated by
2123          commas. The default is to log to <systemitem>stderr</systemitem> 
2124          only.
2125          This parameter can only be set in the <filename>postgresql.conf</>
2126          file or on the server command line.
2127        </para>
2128       </listitem>
2129      </varlistentry>
2130
2131      <varlistentry id="guc-redirect-stderr" xreflabel="redirect_stderr">
2132       <term><varname>redirect_stderr</varname> (<type>boolean</type>)</term>
2133       <indexterm>
2134        <primary><varname>redirect_stderr</> configuration parameter</primary>
2135       </indexterm>
2136       <listitem>
2137        <para>
2138          This parameter allows messages sent to <application>stderr</> to be
2139          captured and redirected into log files.
2140          This method, in combination with logging to <application>stderr</>,
2141          is often more useful than
2142          logging to <application>syslog</>, since some types of messages
2143          may not appear in <application>syslog</> output (a common example
2144          is dynamic-linker failure messages).
2145          This parameter can only be set at server start.
2146        </para>
2147       </listitem>
2148      </varlistentry>
2149
2150      <varlistentry id="guc-log-directory" xreflabel="log_directory">
2151       <term><varname>log_directory</varname> (<type>string</type>)</term>
2152       <indexterm>
2153        <primary><varname>log_directory</> configuration parameter</primary>
2154       </indexterm>
2155       <listitem>
2156        <para>
2157         When <varname>redirect_stderr</> is enabled, this parameter
2158         determines the directory in which log files will be created.
2159         It may be specified as an absolute path, or relative to the
2160         cluster data directory.
2161         This parameter can only be set in the <filename>postgresql.conf</>
2162         file or on the server command line.
2163        </para>
2164       </listitem>
2165      </varlistentry>
2166
2167      <varlistentry id="guc-log-filename" xreflabel="log_filename">
2168       <term><varname>log_filename</varname> (<type>string</type>)</term>
2169       <indexterm>
2170        <primary><varname>log_filename</> configuration parameter</primary>
2171       </indexterm>
2172       <listitem>
2173        <para>
2174         When <varname>redirect_stderr</varname> is enabled, this parameter
2175         sets the file names of the created log files.  The value
2176         is treated as a <systemitem>strftime</systemitem> pattern,
2177         so <literal>%</literal>-escapes
2178         can be used to specify time-varying file names.
2179         If no <literal>%</literal>-escapes are present,
2180         <productname>PostgreSQL</productname> will
2181         append the epoch of the new log file's open time.  For example,
2182         if <varname>log_filename</varname> were <literal>server_log</literal>, then the
2183         chosen file name would be <literal>server_log.1093827753</literal>
2184         for a log starting at Sun Aug 29 19:02:33 2004 MST.
2185         This parameter can only be set in the <filename>postgresql.conf</>
2186         file or on the server command line.
2187        </para>
2188       </listitem>
2189      </varlistentry>
2190
2191      <varlistentry id="guc-log-rotation-age" xreflabel="log_rotation_age">
2192       <term><varname>log_rotation_age</varname> (<type>integer</type>)</term>
2193       <indexterm>
2194        <primary><varname>log_rotation_age</> configuration parameter</primary>
2195       </indexterm>
2196       <listitem>
2197        <para>
2198         When <varname>redirect_stderr</varname> is enabled, this parameter
2199         determines the maximum lifetime of an individual log file.
2200         After this many minutes have elapsed, a new log file will
2201         be created.  Set to zero to disable time-based creation of
2202         new log files.
2203         This parameter can only be set in the <filename>postgresql.conf</>
2204         file or on the server command line.
2205        </para>
2206       </listitem>
2207      </varlistentry>
2208
2209      <varlistentry id="guc-log-rotation-size" xreflabel="log_rotation_size">
2210       <term><varname>log_rotation_size</varname> (<type>integer</type>)</term>
2211       <indexterm>
2212        <primary><varname>log_rotation_size</> configuration parameter</primary>
2213       </indexterm>
2214       <listitem>
2215        <para>
2216         When <varname>redirect_stderr</varname> is enabled, this parameter
2217         determines the maximum size of an individual log file.
2218         After this many kilobytes have been emitted into a log file,
2219         a new log file will be created.  Set to zero to disable size-based
2220         creation of new log files.
2221         This parameter can only be set in the <filename>postgresql.conf</>
2222         file or on the server command line.
2223        </para>
2224       </listitem>
2225      </varlistentry>
2226
2227      <varlistentry id="guc-log-truncate-on-rotation" xreflabel="log_truncate_on_rotation">
2228       <term><varname>log_truncate_on_rotation</varname> (<type>boolean</type>)</term>
2229       <indexterm>
2230        <primary><varname>log_truncate_on_rotation</> configuration parameter</primary>
2231       </indexterm>
2232       <listitem>
2233        <para>
2234         When <varname>redirect_stderr</varname> is enabled, this parameter will cause
2235         <productname>PostgreSQL</productname> to truncate (overwrite),
2236         rather than append to, any existing log file of the same name.
2237         However, truncation will occur only when a new file is being opened
2238         due to time-based rotation, not during server startup or size-based
2239         rotation.  When off, pre-existing files will be appended to in
2240         all cases.  For example, using this setting in combination with
2241         a <varname>log_filename</varname> like <literal>postgresql-%H.log</literal>
2242         would result in generating twenty-four hourly log files and then
2243         cyclically overwriting them.
2244         This parameter can only be set in the <filename>postgresql.conf</>
2245         file or on the server command line.
2246        </para>
2247        <para>
2248         Example:  To keep 7 days of logs, one log file per day named
2249         <literal>server_log.Mon</literal>, <literal>server_log.Tue</literal>, 
2250         etc, and automatically overwrite last week's log with this week's log,
2251         set <varname>log_filename</varname> to <literal>server_log.%a</literal>, 
2252         <varname>log_truncate_on_rotation</varname> to <literal>on</literal>, and 
2253         <varname>log_rotation_age</varname> to <literal>1440</literal>.
2254        </para>
2255        <para>
2256         Example: To keep 24 hours of logs, one log file per hour, but 
2257         also rotate sooner if the log file size exceeds 1GB, set 
2258         <varname>log_filename</varname> to <literal>server_log.%H%M</literal>, 
2259         <varname>log_truncate_on_rotation</varname> to <literal>on</literal>, 
2260         <varname>log_rotation_age</varname> to <literal>60</literal>, and 
2261         <varname>log_rotation_size</varname> to <literal>1000000</literal>.
2262         Including <literal>%M</> in <varname>log_filename</varname> allows
2263         any size-driven rotations that may occur to select a file name
2264         different from the hour's initial file name.
2265        </para>
2266       </listitem>
2267      </varlistentry>
2268
2269      <varlistentry id="guc-syslog-facility" xreflabel="syslog_facility">
2270       <term><varname>syslog_facility</varname> (<type>string</type>)</term>
2271       <indexterm>
2272        <primary><varname>syslog_facility</> configuration parameter</primary>
2273       </indexterm>
2274       <listitem>
2275        <para>
2276         When logging to <application>syslog</> is enabled, this parameter
2277         determines the <application>syslog</application>
2278         <quote>facility</quote> to be used.  You may choose
2279         from <literal>LOCAL0</>, <literal>LOCAL1</>,
2280         <literal>LOCAL2</>, <literal>LOCAL3</>, <literal>LOCAL4</>,
2281         <literal>LOCAL5</>, <literal>LOCAL6</>, <literal>LOCAL7</>;
2282         the default is <literal>LOCAL0</>. See also the
2283         documentation of your system's
2284         <application>syslog</application> daemon.
2285         This parameter can only be set in the <filename>postgresql.conf</>
2286         file or on the server command line.
2287        </para>
2288       </listitem>
2289      </varlistentry>
2290      
2291      <varlistentry id="guc-syslog-ident" xreflabel="syslog_ident">
2292       <term><varname>syslog_ident</varname> (<type>string</type>)</term>
2293       <indexterm>
2294        <primary><varname>syslog_identity</> configuration parameter</primary>
2295       </indexterm>
2296        <listitem>
2297         <para>
2298          When logging to <application>syslog</> is enabled, this parameter
2299          determines the program name used to identify
2300          <productname>PostgreSQL</productname> messages in
2301          <application>syslog</application> logs. The default is
2302          <literal>postgres</literal>.
2303          This parameter can only be set in the <filename>postgresql.conf</>
2304          file or on the server command line.
2305         </para>
2306        </listitem>
2307       </varlistentry>
2308       
2309       </variablelist>
2310     </sect2>
2311      <sect2 id="runtime-config-logging-when">
2312      <title>When To Log</title>
2313
2314      <variablelist>
2315
2316      <varlistentry id="guc-client-min-messages" xreflabel="client_min_messages">
2317       <term><varname>client_min_messages</varname> (<type>string</type>)</term>
2318       <indexterm>
2319        <primary><varname>client_min_messages</> configuration parameter</primary>
2320       </indexterm>
2321       <listitem>
2322        <para>
2323         Controls which message levels are sent to the client.
2324         Valid values are <literal>DEBUG5</>,
2325         <literal>DEBUG4</>, <literal>DEBUG3</>, <literal>DEBUG2</>,
2326         <literal>DEBUG1</>, <literal>LOG</>, <literal>NOTICE</>,
2327         <literal>WARNING</>, <literal>ERROR</>, <literal>FATAL</>,
2328         and <literal>PANIC</>.  Each level
2329         includes all the levels that follow it.  The later the level,
2330         the fewer messages are sent.  The default is
2331         <literal>NOTICE</>.  Note that <literal>LOG</> has a different
2332         rank here than in <varname>log_min_messages</>.
2333        </para>
2334       </listitem>
2335      </varlistentry>
2336
2337      <varlistentry id="guc-log-min-messages" xreflabel="log_min_messages">
2338       <term><varname>log_min_messages</varname> (<type>string</type>)</term>
2339       <indexterm>
2340        <primary><varname>log_min_messages</> configuration parameter</primary>
2341       </indexterm>
2342       <listitem>
2343        <para>
2344         Controls which message levels are written to the server log.
2345         Valid values are <literal>DEBUG5</>, <literal>DEBUG4</>,
2346         <literal>DEBUG3</>, <literal>DEBUG2</>, <literal>DEBUG1</>,
2347         <literal>INFO</>, <literal>NOTICE</>, <literal>WARNING</>,
2348         <literal>ERROR</>, <literal>LOG</>, <literal>FATAL</>, and
2349         <literal>PANIC</>.  Each level includes all the levels that
2350         follow it.  The later the level, the fewer messages are sent
2351         to the log.  The default is <literal>NOTICE</>.  Note that
2352         <literal>LOG</> has a different rank here than in
2353         <varname>client_min_messages</>.
2354         Only superusers can change this setting.
2355        </para>
2356       </listitem>
2357      </varlistentry>
2358
2359      <varlistentry id="guc-log-error-verbosity" xreflabel="log_error_verbosity">
2360       <term><varname>log_error_verbosity</varname> (<type>string</type>)</term>
2361       <indexterm>
2362        <primary><varname>log_error_verbosity</> configuration parameter</primary>
2363       </indexterm>
2364       <listitem>
2365        <para>
2366         Controls the amount of detail written in the server log for each
2367         message that is logged.  Valid values are <literal>TERSE</>,
2368         <literal>DEFAULT</>, and <literal>VERBOSE</>, each adding more
2369         fields to displayed messages.
2370         Only superusers can change this setting.
2371        </para>
2372       </listitem>
2373      </varlistentry>
2374
2375      <varlistentry id="guc-log-min-error-statement" xreflabel="log_min_error_statement">
2376       <term><varname>log_min_error_statement</varname> (<type>string</type>)</term>
2377       <indexterm>
2378        <primary><varname>log_min_error_statement</> configuration parameter</primary>
2379       </indexterm>
2380       <listitem>
2381        <para>
2382         Controls whether or not the SQL statement that causes an error
2383         condition will also be recorded in the server log. All SQL
2384         statements that cause an error of the specified level or
2385         higher are logged.  The default is
2386         <literal>PANIC</literal> (effectively turning this feature
2387         off for normal use). Valid values are <literal>DEBUG5</literal>,
2388         <literal>DEBUG4</literal>, <literal>DEBUG3</literal>,
2389         <literal>DEBUG2</literal>, <literal>DEBUG1</literal>,
2390         <literal>INFO</literal>, <literal>NOTICE</literal>,
2391         <literal>WARNING</literal>, <literal>ERROR</literal>,
2392         <literal>FATAL</literal>, and <literal>PANIC</literal>.  For
2393         example, if you set this to <literal>ERROR</literal> then all
2394         SQL statements causing errors, fatal errors, or panics will be
2395         logged. Enabling this parameter can be helpful in tracking down
2396         the source of any errors that appear in the server log.
2397         Only superusers can change this setting.
2398        </para>
2399       </listitem>
2400      </varlistentry>
2401      
2402      <varlistentry id="guc-log-min-duration-statement" xreflabel="log_min_duration_statement">
2403       <term><varname>log_min_duration_statement</varname> (<type>integer</type>)</term>
2404       <indexterm>
2405        <primary><varname>log_min_duration_statement</> configuration parameter</primary>
2406       </indexterm>
2407        <listitem>
2408         <para>
2409          Logs the statement and its duration on a single log line if its
2410          duration is greater than or equal to the specified number of
2411          milliseconds. Setting this to zero will print all statements
2412          and their durations. Minus-one (the default) disables the
2413          feature. For example, if you set it to <literal>250</literal>
2414          then all SQL statements that run 250ms or longer will be
2415          logged. Enabling this parameter can be useful in tracking down
2416          unoptimized queries in your applications. This setting is
2417          independent of <varname>log_statement</varname> and
2418          <varname>log_duration</varname>. Only superusers can change
2419          this setting.
2420         </para>
2421        </listitem>
2422       </varlistentry>
2423
2424      <varlistentry id="guc-silent-mode" xreflabel="silent_mode">
2425       <term><varname>silent_mode</varname> (<type>boolean</type>)</term>
2426       <indexterm>
2427        <primary><varname>silent_mode</> configuration parameter</primary>
2428       </indexterm>
2429       <listitem>
2430        <para>
2431         Runs the server silently. If this parameter is set, the server
2432         will automatically run in background and any controlling
2433         terminals are disassociated.
2434         The server's standard output and standard error are redirected
2435         to <literal>/dev/null</>, so any messages sent to them will be lost.
2436         Unless <application>syslog</> logging is selected or
2437         <varname>redirect_stderr</> is enabled, using this parameter
2438         is discouraged because it makes it impossible to see error messages.
2439         This parameter can only be set at server start.
2440        </para>
2441       </listitem>
2442      </varlistentry>
2443
2444      </variablelist>
2445
2446        <para>
2447         Here is a list of the various message severity levels used in
2448         these settings:
2449         <variablelist>
2450          <varlistentry>
2451           <term><literal>DEBUG[1-5]</literal></term>
2452           <listitem>
2453            <para>
2454             Provides information for use by developers.
2455            </para>
2456           </listitem>
2457          </varlistentry>
2458
2459          <varlistentry>
2460           <term><literal>INFO</literal></term>
2461           <listitem>
2462            <para>
2463             Provides information implicitly requested by the user,
2464             e.g., during <command>VACUUM VERBOSE</>.
2465            </para>
2466           </listitem>
2467          </varlistentry>
2468
2469          <varlistentry>
2470           <term><literal>NOTICE</literal></term>
2471           <listitem>
2472            <para>
2473             Provides information that may be helpful to users, e.g.,
2474             truncation of long identifiers and the creation of indexes as part
2475             of primary keys.
2476            </para>
2477           </listitem>
2478          </varlistentry>
2479
2480          <varlistentry>
2481           <term><literal>WARNING</literal></term>
2482           <listitem>
2483            <para>
2484             Provides warnings to the user, e.g., <command>COMMIT</>
2485             outside a transaction block.
2486            </para>
2487           </listitem>
2488          </varlistentry>
2489
2490          <varlistentry>
2491           <term><literal>ERROR</literal></term>
2492           <listitem>
2493            <para>
2494             Reports an error that caused the current command to abort.
2495            </para>
2496           </listitem>
2497          </varlistentry>
2498
2499          <varlistentry>
2500           <term><literal>LOG</literal></term>
2501           <listitem>
2502            <para>
2503             Reports information of interest to administrators, e.g.,
2504             checkpoint activity.
2505            </para>
2506           </listitem>
2507          </varlistentry>
2508
2509          <varlistentry>
2510           <term><literal>FATAL</literal></term>
2511           <listitem>
2512            <para>
2513             Reports an error that caused the current session to abort.
2514            </para>
2515           </listitem>
2516          </varlistentry>
2517
2518          <varlistentry>
2519           <term><literal>PANIC</literal></term>
2520           <listitem>
2521            <para>
2522             Reports an error that caused all sessions to abort.
2523            </para>
2524           </listitem>
2525          </varlistentry>
2526         </variablelist>
2527        </para>
2528
2529     </sect2>
2530      <sect2 id="runtime-config-logging-what">
2531      <title>What To Log</title>
2532
2533      <variablelist>
2534
2535      <varlistentry>
2536       <term><varname>debug_print_parse</varname> (<type>boolean</type>)</term>
2537       <term><varname>debug_print_rewritten</varname> (<type>boolean</type>)</term>
2538       <term><varname>debug_print_plan</varname> (<type>boolean</type>)</term>
2539       <term><varname>debug_pretty_print</varname> (<type>boolean</type>)</term>
2540       <indexterm>
2541        <primary><varname>debug_print_parse</> configuration parameter</primary>
2542       </indexterm>
2543       <indexterm>
2544        <primary><varname>debug_print_rewritten</> configuration parameter</primary>
2545       </indexterm>
2546       <indexterm>
2547        <primary><varname>debug_print_plan</> configuration parameter</primary>
2548       </indexterm>
2549       <indexterm>
2550        <primary><varname>debug_pretty_print</> configuration parameter</primary>
2551       </indexterm>
2552       <listitem>
2553        <para>
2554         These parameters enable various debugging output to be emitted.
2555         For each executed query, they print
2556         the resulting parse tree, the query rewriter output, or the
2557         execution plan.  <varname>debug_pretty_print</varname> indents
2558         these displays to produce a more readable but much longer
2559         output format.  <varname>client_min_messages</varname> or
2560         <varname>log_min_messages</varname> must be
2561         <literal>DEBUG1</literal> or lower to actually send this output
2562         to the client or the server log, respectively.
2563         These parameters are off by default.
2564        </para>
2565       </listitem>
2566      </varlistentry>
2567
2568      <varlistentry id="guc-log-connections" xreflabel="log_connections">
2569       <term><varname>log_connections</varname> (<type>boolean</type>)</term>
2570       <indexterm>
2571        <primary><varname>log_connections</> configuration parameter</primary>
2572       </indexterm>
2573       <listitem>
2574        <para>
2575         This outputs a line to the server log detailing each successful
2576         connection. This is off by default, although it is probably very
2577         useful.  Some client programs, like <application>psql</>, attempt 
2578         to connect twice while determining if a password is required, so 
2579         duplicate <quote>connection received</> messages do not
2580         necessarily indicate a problem.
2581         This parameter can only be set in the <filename>postgresql.conf</>
2582         file or on the server command line.
2583        </para>
2584       </listitem>
2585      </varlistentry>
2586
2587      <varlistentry id="guc-log-disconnections" xreflabel="log_disconnections">
2588       <term><varname>log_disconnections</varname> (<type>boolean</type>)</term>
2589       <indexterm>
2590        <primary><varname>log_disconnections</> configuration parameter</primary>
2591       </indexterm>
2592       <listitem>
2593        <para>
2594         This outputs a line in the server log similar to
2595         <varname>log_connections</varname> but at session termination,
2596         and includes the duration of the session.  This is off by
2597         default.
2598         This parameter can only be set in the <filename>postgresql.conf</>
2599         file or on the server command line.
2600        </para>
2601       </listitem>
2602      </varlistentry>
2603
2604
2605      <varlistentry id="guc-log-duration" xreflabel="log_duration">
2606       <term><varname>log_duration</varname> (<type>boolean</type>)</term>
2607       <indexterm>
2608        <primary><varname>log_duration</> configuration parameter</primary>
2609       </indexterm>
2610       <listitem>
2611        <para>
2612         Causes the duration of every completed statement which satisfies
2613         <varname>log_statement</> to be logged.  When using this option, 
2614         if you are not using <application>syslog</>, it is recommended 
2615         that you log the PID or session ID using <varname>log_line_prefix</> 
2616         so that you can link the statement message to the later
2617         duration message using the process ID or session ID. The default is
2618         <literal>off</>. Only superusers can change this setting.
2619        </para>
2620       </listitem>
2621      </varlistentry>
2622      
2623      <varlistentry id="guc-log-line-prefix" xreflabel="log_line_prefix">
2624       <term><varname>log_line_prefix</varname> (<type>string</type>)</term>
2625       <indexterm>
2626        <primary><varname>log_line_prefix</> configuration parameter</primary>
2627       </indexterm>
2628       <listitem>
2629        <para>
2630          This is a <function>printf</>-style string that is output at the
2631          beginning of each log line. The default is an empty string.
2632          Each recognized escape is replaced as outlined 
2633          below - anything else that looks like an escape is ignored. Other
2634          characters are copied straight to the log line. Some escapes are
2635          only recognized by session processes, and do not apply to
2636          background processes such as the postmaster. <application>Syslog</>
2637          produces its own 
2638          time stamp and process ID information, so you probably do not want to
2639          use those escapes if you are using <application>syslog</>.
2640          This parameter can only be set in the <filename>postgresql.conf</>
2641          file or on the server command line.
2642
2643          <informaltable>
2644           <tgroup cols="3">
2645            <thead>
2646             <row>
2647              <entry>Escape</entry>
2648              <entry>Effect</entry>
2649              <entry>Session only</entry>
2650              </row>
2651             </thead>
2652            <tbody>
2653             <row>
2654              <entry><literal>%u</literal></entry>
2655              <entry>User name</entry>
2656              <entry>yes</entry>
2657             </row>
2658             <row>
2659              <entry><literal>%d</literal></entry>
2660              <entry>Database name</entry>
2661              <entry>yes</entry>
2662             </row>
2663             <row>
2664              <entry><literal>%r</literal></entry>
2665              <entry>Remote host name or IP address, and remote port</entry>
2666              <entry>yes</entry>
2667             </row>
2668             <row>
2669              <entry><literal>%h</literal></entry>
2670              <entry>Remote host name or IP address</entry>
2671              <entry>yes</entry>
2672             </row>
2673             <row>
2674              <entry><literal>%p</literal></entry>
2675              <entry>Process ID</entry>
2676              <entry>no</entry>
2677             </row>
2678             <row>
2679              <entry><literal>%t</literal></entry>
2680              <entry>Time stamp (no milliseconds)</entry>
2681              <entry>no</entry>
2682             </row>
2683             <row>
2684              <entry><literal>%m</literal></entry>
2685              <entry>Time stamp with milliseconds</entry>
2686              <entry>no</entry>
2687             </row>
2688             <row>
2689              <entry><literal>%i</literal></entry>
2690              <entry>Command tag: This is the command that generated the log line.</entry>
2691              <entry>yes</entry>
2692             </row>
2693             <row>
2694              <entry><literal>%c</literal></entry>
2695              <entry>Session ID: A unique identifier for each session.
2696              It is 2 4-byte hexadecimal numbers (without leading zeros) 
2697              separated by a dot. The numbers
2698              are the session start time and the process ID, so this can also
2699              be used as a space saving way of printing these items.</entry>
2700              <entry>yes</entry>
2701             </row>
2702             <row>
2703              <entry><literal>%l</literal></entry>
2704              <entry>Number of the log line for each process, starting at 1</entry>
2705              <entry>no</entry>
2706             </row>
2707             <row>
2708              <entry><literal>%s</literal></entry>
2709              <entry>Session start time stamp</entry>
2710              <entry>yes</entry>
2711             </row>
2712             <row>
2713              <entry><literal>%x</literal></entry>
2714              <entry>Transaction ID</entry>
2715              <entry>yes</entry>
2716             </row>
2717             <row>
2718              <entry><literal>%q</literal></entry>
2719              <entry>Does not produce any output, but tells non-session
2720              processes to stop at this point in the string. Ignored by
2721              session processes.</entry>
2722              <entry>no</entry>
2723             </row>
2724             <row>
2725              <entry><literal>%%</literal></entry>
2726              <entry>Literal <literal>%</></entry>
2727              <entry>no</entry>
2728             </row>
2729            </tbody>
2730           </tgroup>
2731          </informaltable>
2732        </para>
2733       </listitem>
2734      </varlistentry>
2735
2736      <varlistentry id="guc-log-statement" xreflabel="log_statement">
2737       <term><varname>log_statement</varname> (<type>string</type>)</term>
2738       <indexterm>
2739        <primary><varname>log_statement</> configuration parameter</primary>
2740       </indexterm>
2741       <listitem>
2742        <para>
2743         Controls which SQL statements are logged. Valid values are
2744         <literal>none</>, <literal>ddl</>, <literal>mod</>, and
2745         <literal>all</>. <literal>ddl</> logs all data definition
2746         commands like <literal>CREATE</>, <literal>ALTER</>, and
2747         <literal>DROP</> commands. <literal>mod</> logs all
2748         <literal>ddl</> statements, plus <literal>INSERT</>,
2749         <literal>UPDATE</>, <literal>DELETE</>, <literal>TRUNCATE</>,
2750         and <literal>COPY FROM</>. <literal>PREPARE</> and
2751         <literal>EXPLAIN ANALYZE</> statements are also logged if their
2752         contained command is of an appropriate type.
2753        </para>
2754        <para>
2755         The default is <literal>none</>. Only superusers can change this
2756         setting.
2757        </para>
2758
2759        <note>
2760         <para>
2761          The <command>EXECUTE</command> statement is not considered a
2762          <literal>ddl</> or <literal>mod</> statement.  When it is logged, 
2763          only the name of the prepared statement is reported, not the
2764          actual prepared statement.
2765         </para>
2766
2767         <para>
2768          When a function is defined in the
2769          <application>PL/pgSQL</application>server-side language, any queries
2770          executed by the function will only be logged the first time that the
2771          function is invoked in a particular session. This is because
2772          <application>PL/pgSQL</application> keeps a cache of the
2773          query plans produced for the SQL statements in the function.
2774         </para>
2775        </note>
2776       </listitem>
2777      </varlistentry>
2778
2779      <varlistentry id="guc-log-hostname" xreflabel="log_hostname">
2780       <term><varname>log_hostname</varname> (<type>boolean</type>)</term>
2781       <indexterm>
2782        <primary><varname>log_hostname</> configuration parameter</primary>
2783       </indexterm>
2784       <listitem>
2785        <para>
2786         By default, connection log messages only show the IP address of the
2787         connecting host. Turning on this parameter causes logging of the
2788         host name as well.  Note that depending on your host name resolution
2789         setup this might impose a non-negligible performance penalty.
2790         This parameter can only be set in the <filename>postgresql.conf</>
2791         file or on the server command line.
2792        </para>
2793       </listitem>
2794      </varlistentry>
2795
2796      </variablelist>
2797     </sect2>
2798    </sect1>
2799
2800    <sect1 id="runtime-config-statistics">
2801     <title>Run-Time Statistics</title>
2802
2803     <sect2 id="runtime-config-statistics-monitor">
2804      <title>Statistics Monitoring</title>
2805      <variablelist>
2806
2807      <varlistentry>
2808       <term><varname>log_statement_stats</varname> (<type>boolean</type>)</term>
2809       <term><varname>log_parser_stats</varname> (<type>boolean</type>)</term>
2810       <term><varname>log_planner_stats</varname> (<type>boolean</type>)</term>
2811       <term><varname>log_executor_stats</varname> (<type>boolean</type>)</term>
2812       <indexterm>
2813        <primary><varname>log_statement_stats</> configuration parameter</primary>
2814       </indexterm>
2815       <indexterm>
2816        <primary><varname>log_parser_stats</> configuration parameter</primary>
2817       </indexterm>
2818       <indexterm>
2819        <primary><varname>log_planner_stats</> configuration parameter</primary>
2820       </indexterm>
2821       <indexterm>
2822        <primary><varname>log_executor_stats</> configuration parameter</primary>
2823       </indexterm>
2824       <listitem>
2825        <para>
2826         For each query, write performance statistics of the respective
2827         module to the server log. This is a crude profiling
2828         instrument.  <varname>log_statement_stats</varname> reports total
2829         statement statistics, while the others report per-module statistics.
2830         <varname>log_statement_stats</varname> cannot be enabled together with
2831         any of the per-module options.  All of these options are disabled by
2832         default.   Only superusers can change these settings.
2833        </para>
2834       </listitem>
2835      </varlistentry>
2836
2837      </variablelist>
2838
2839     </sect2>
2840     <sect2 id="runtime-config-statistics-collector">
2841      <title>Query and Index Statistics Collector</title>
2842
2843      <para>
2844       These parameters control a server-wide statistics collection feature.
2845       When statistics collection is enabled, the data that is produced can be
2846       accessed via the <structname>pg_stat</structname> and
2847       <structname>pg_statio</structname> family of system views.
2848       Refer to <xref linkend="monitoring"> for more information.
2849      </para>
2850
2851      <variablelist>
2852
2853      <varlistentry id="guc-stats-start-collector" xreflabel="stats_start_collector">
2854       <term><varname>stats_start_collector</varname> (<type>boolean</type>)</term>
2855       <indexterm>
2856        <primary><varname>stats_start_collector</> configuration parameter</primary>
2857       </indexterm>
2858       <listitem>
2859        <para>
2860         Controls whether the server should start the
2861         statistics-collection subprocess.  This is on by default, but
2862         may be turned off if you know you have no interest in
2863         collecting statistics or running autovacuum.
2864         This parameter can only be set at server start, because the collection
2865         subprocess cannot be started or stopped on-the-fly.  (However, the
2866         extent to which statistics are actually gathered can be changed while
2867         the server is running, so long as the subprocess exists.)
2868        </para>
2869       </listitem>
2870      </varlistentry>
2871
2872      <varlistentry id="guc-stats-command-string" xreflabel="stats_command_string">
2873       <term><varname>stats_command_string</varname> (<type>boolean</type>)</term>
2874       <indexterm>
2875        <primary><varname>stats_command_string</> configuration parameter</primary>
2876       </indexterm>
2877       <listitem>
2878        <para>
2879         Enables the collection of statistics on the currently
2880         executing command of each session, along with the time at
2881         which that command began execution. This parameter is off by
2882         default. Note that even when enabled, this information is not
2883         visible to all users, only to superusers and the user owning
2884         the session being reported on; so it should not represent a
2885         security risk.
2886         Only superusers can change this setting.
2887        </para>
2888       </listitem>
2889      </varlistentry>
2890
2891      <varlistentry id="guc-stats-block-level" xreflabel="stats_block_level">
2892       <term><varname>stats_block_level</varname> (<type>boolean</type>)</term>
2893       <indexterm>
2894        <primary><varname>stats_block_level</> configuration parameter</primary>
2895       </indexterm>
2896       <listitem>
2897        <para>
2898         Enables the collection of block-level statistics on database
2899         activity. This parameter is off by default.
2900         Only superusers can change this setting.
2901        </para>
2902       </listitem>
2903      </varlistentry>
2904
2905      <varlistentry id="guc-stats-row-level" xreflabel="stats_row_level">
2906       <term><varname>stats_row_level</varname> (<type>boolean</type>)</term>
2907       <indexterm>
2908        <primary><varname>stats_row_level</> configuration parameter</primary>
2909       </indexterm>
2910       <listitem>
2911        <para>
2912         Enables the collection of row-level statistics on database
2913         activity. This parameter is off by default.
2914         Only superusers can change this setting.
2915        </para>
2916       </listitem>
2917      </varlistentry>
2918
2919      <varlistentry id="guc-stats-reset-on-server-start" xreflabel="stats_reset_on_server_start">
2920       <term><varname>stats_reset_on_server_start</varname> (<type>boolean</type>)</term>
2921       <indexterm>
2922        <primary><varname>stats_reset_on_server_start</> configuration parameter</primary>
2923       </indexterm>
2924       <listitem>
2925        <para>
2926         If on, collected statistics are zeroed out whenever the server
2927         is restarted. If off, statistics are accumulated across server
2928         restarts. The default is <literal>off</>. This parameter can only 
2929         be set at server start.
2930        </para>
2931       </listitem>
2932      </varlistentry>
2933
2934      </variablelist>
2935     </sect2>
2936    </sect1>
2937
2938    <sect1 id="runtime-config-autovacuum">
2939     <title>Automatic Vacuuming</title>
2940
2941     <indexterm>
2942      <primary>autovacuum</primary>
2943      <secondary>configuration parameters</secondary>
2944     </indexterm>
2945
2946      <para>
2947       These settings control the behavior of the <firstterm>autovacuum</>
2948       feature.  Refer to <xref linkend="autovacuum"> for
2949       more information.
2950      </para>
2951
2952     <variablelist>
2953
2954      <varlistentry id="guc-autovacuum" xreflabel="autovacuum">
2955       <term><varname>autovacuum</varname> (<type>boolean</type>)</term>
2956       <indexterm>
2957        <primary><varname>autovacuum</> configuration parameter</primary>
2958       </indexterm>
2959       <listitem>
2960        <para>
2961         Controls whether the server should run the
2962         autovacuum daemon.  This is off by default.
2963         <varname>stats_start_collector</> and <varname>stats_row_level</>
2964         must also be turned on for autovacuum to work.
2965         This parameter can only be set in the <filename>postgresql.conf</>
2966         file or on the server command line.
2967        </para>
2968       </listitem>
2969      </varlistentry>
2970
2971      <varlistentry id="guc-autovacuum-naptime" xreflabel="autovacuum_naptime">
2972       <term><varname>autovacuum_naptime</varname> (<type>integer</type>)</term>
2973       <indexterm>
2974        <primary><varname>autovacuum_naptime</> configuration parameter</primary>
2975       </indexterm>
2976       <listitem>
2977        <para>
2978         Specifies the delay between activity rounds for the autovacuum
2979         daemon.  In each round the daemon examines one database
2980         and issues <command>VACUUM</> and <command>ANALYZE</> commands
2981         as needed for tables in that database.  The delay is measured
2982         in seconds, and the default is 60.
2983         This parameter can only be set in the <filename>postgresql.conf</>
2984         file or on the server command line.
2985        </para>
2986       </listitem>
2987      </varlistentry>
2988
2989      <varlistentry id="guc-autovacuum-vacuum-threshold" xreflabel="autovacuum_vacuum_threshold">
2990       <term><varname>autovacuum_vacuum_threshold</varname> (<type>integer</type>)</term>
2991       <indexterm>
2992        <primary><varname>autovacuum_vacuum_threshold</> configuration parameter</primary>
2993       </indexterm>
2994       <listitem>
2995        <para>
2996         Specifies the minimum number of updated or deleted tuples needed
2997         to trigger a <command>VACUUM</> in any one table.
2998         The default is 1000.
2999         This parameter can only be set in the <filename>postgresql.conf</>
3000         file or on the server command line.
3001         This setting can be overridden for individual tables by entries in
3002         <structname>pg_autovacuum</>.
3003        </para>
3004       </listitem>
3005      </varlistentry>
3006
3007      <varlistentry id="guc-autovacuum-analyze-threshold" xreflabel="autovacuum_analyze_threshold">
3008       <term><varname>autovacuum_analyze_threshold</varname> (<type>integer</type>)</term>
3009       <indexterm>
3010        <primary><varname>autovacuum_analyze_threshold</> configuration parameter</primary>
3011       </indexterm>
3012       <listitem>
3013        <para>
3014         Specifies the minimum number of inserted, updated or deleted tuples
3015         needed to trigger an <command>ANALYZE</> in any one table.
3016         The default is 500.
3017         This parameter can only be set in the <filename>postgresql.conf</>
3018         file or on the server command line.
3019         This setting can be overridden for individual tables by entries in
3020         <structname>pg_autovacuum</>.
3021        </para>
3022       </listitem>
3023      </varlistentry>
3024
3025      <varlistentry id="guc-autovacuum-vacuum-scale-factor" xreflabel="autovacuum_vacuum_scale_factor">
3026       <term><varname>autovacuum_vacuum_scale_factor</varname> (<type>floating point</type>)</term>
3027       <indexterm>
3028        <primary><varname>autovacuum_vacuum_scale_factor</> configuration parameter</primary>
3029       </indexterm>
3030       <listitem>
3031        <para>
3032         Specifies a fraction of the table size to add to
3033         <varname>autovacuum_vacuum_threshold</varname>
3034         when deciding whether to trigger a <command>VACUUM</>.
3035         The default is 0.4.
3036         This parameter can only be set in the <filename>postgresql.conf</>
3037         file or on the server command line.
3038         This setting can be overridden for individual tables by entries in
3039         <structname>pg_autovacuum</>.
3040        </para>
3041       </listitem>
3042      </varlistentry>
3043
3044      <varlistentry id="guc-autovacuum-analyze-scale-factor" xreflabel="autovacuum_analyze_scale_factor">
3045       <term><varname>autovacuum_analyze_scale_factor</varname> (<type>floating point</type>)</term>
3046       <indexterm>
3047        <primary><varname>autovacuum_analyze_scale_factor</> configuration parameter</primary>
3048       </indexterm>
3049       <listitem>
3050        <para>
3051         Specifies a fraction of the table size to add to
3052         <varname>autovacuum_analyze_threshold</varname>
3053         when deciding whether to trigger an <command>ANALYZE</>.
3054         The default is 0.2.
3055         This parameter can only be set in the <filename>postgresql.conf</>
3056         file or on the server command line.
3057         This setting can be overridden for individual tables by entries in
3058         <structname>pg_autovacuum</>.
3059        </para>
3060       </listitem>
3061      </varlistentry>
3062
3063      <varlistentry id="guc-autovacuum-vacuum-cost-delay" xreflabel="autovacuum_vacuum_cost_delay">
3064       <term><varname>autovacuum_vacuum_cost_delay</varname> (<type>integer</type>)</term>
3065       <indexterm>
3066        <primary><varname>autovacuum_vacuum_cost_delay</> configuration parameter</primary>
3067       </indexterm>
3068       <listitem>
3069        <para>
3070         Specifies the cost delay value that will be used in automatic
3071         <command>VACUUM</> operations.  If -1 is specified (which is the
3072         default), the regular
3073         <xref linkend="guc-vacuum-cost-delay"> value will be used.
3074         This parameter can only be set in the <filename>postgresql.conf</>
3075         file or on the server command line.
3076         This setting can be overridden for individual tables by entries in
3077         <structname>pg_autovacuum</>.
3078        </para>
3079       </listitem>
3080      </varlistentry>
3081
3082      <varlistentry id="guc-autovacuum-vacuum-cost-limit" xreflabel="autovacuum_vacuum_cost_limit">
3083       <term><varname>autovacuum_vacuum_cost_limit</varname> (<type>integer</type>)</term>
3084       <indexterm>
3085        <primary><varname>autovacuum_vacuum_cost_limit</> configuration parameter</primary>
3086       </indexterm>
3087       <listitem>
3088        <para>
3089         Specifies the cost limit value that will be used in automatic
3090         <command>VACUUM</> operations.  If -1 is specified (which is the
3091         default), the regular
3092         <xref linkend="guc-vacuum-cost-limit"> value will be used.
3093         This parameter can only be set in the <filename>postgresql.conf</>
3094         file or on the server command line.
3095         This setting can be overridden for individual tables by entries in
3096         <structname>pg_autovacuum</>.
3097        </para>
3098       </listitem>
3099      </varlistentry>
3100
3101     </variablelist>
3102    </sect1>
3103
3104    <sect1 id="runtime-config-client">
3105     <title>Client Connection Defaults</title>
3106
3107     <sect2 id="runtime-config-client-statement">
3108      <title>Statement Behavior</title>
3109      <variablelist>
3110
3111      <varlistentry id="guc-search-path" xreflabel="search_path">
3112       <term><varname>search_path</varname> (<type>string</type>)</term>
3113       <indexterm>
3114        <primary><varname>search_path</> configuration parameter</primary>
3115       </indexterm>
3116       <indexterm><primary>path</><secondary>for schemas</></>
3117       <listitem>
3118        <para>
3119         This variable specifies the order in which schemas are searched
3120         when an object (table, data type, function, etc.) is referenced by a
3121         simple name with no schema component.  When there are objects of
3122         identical names in different schemas, the one found first
3123         in the search path is used.  An object that is not in any of the
3124         schemas in the search path can only be referenced by specifying
3125         its containing schema with a qualified (dotted) name.
3126        </para>
3127
3128        <para>
3129         The value for <varname>search_path</varname> has to be a comma-separated
3130         list of schema names.  If one of the list items is
3131         the special value <literal>$user</literal>, then the schema
3132         having the name returned by <function>SESSION_USER</> is substituted, if there
3133         is such a schema.  (If not, <literal>$user</literal> is ignored.)
3134        </para>
3135
3136        <para>
3137         The system catalog schema, <literal>pg_catalog</>, is always
3138         searched, whether it is mentioned in the path or not.  If it is
3139         mentioned in the path then it will be searched in the specified
3140         order.  If <literal>pg_catalog</> is not in the path then it will
3141         be searched <emphasis>before</> searching any of the path items.
3142         It should also be noted that the temporary-table schema,
3143         <literal>pg_temp_<replaceable>nnn</></>, is implicitly searched before any of
3144         these.
3145        </para>
3146
3147        <para>
3148         When objects are created without specifying a particular target
3149         schema, they will be placed in the first schema listed
3150         in the search path.  An error is reported if the search path is
3151         empty.
3152        </para>
3153
3154        <para>
3155         The default value for this parameter is
3156         <literal>'"$user", public'</literal> (where the second part will be
3157         ignored if there is no schema named <literal>public</>).
3158         This supports shared use of a database (where no users
3159         have private schemas, and all share use of <literal>public</>),
3160         private per-user schemas, and combinations of these.  Other
3161         effects can be obtained by altering the default search path
3162         setting, either globally or per-user.
3163        </para>
3164
3165        <para>
3166         The current effective value of the search path can be examined
3167         via the <acronym>SQL</acronym> function
3168         <function>current_schemas()</>.  This is not quite the same as
3169         examining the value of <varname>search_path</varname>, since
3170         <function>current_schemas()</> shows how the requests
3171         appearing in <varname>search_path</varname> were resolved.
3172        </para>
3173
3174        <para>
3175         For more information on schema handling, see <xref linkend="ddl-schemas">.
3176        </para>
3177       </listitem>
3178      </varlistentry>
3179
3180      <varlistentry id="guc-default-tablespace" xreflabel="default_tablespace">
3181       <term><varname>default_tablespace</varname> (<type>string</type>)</term>
3182       <indexterm>
3183        <primary><varname>default_tablespace</> configuration parameter</primary>
3184       </indexterm>
3185       <indexterm><primary>tablespace</><secondary>default</></>
3186       <listitem>
3187        <para>
3188         This variable specifies the default tablespace in which to create
3189         objects (tables and indexes) when a <command>CREATE</> command does
3190         not explicitly specify a tablespace.
3191        </para>
3192
3193        <para>
3194         The value is either the name of a tablespace, or an empty string
3195         to specify using the default tablespace of the current database.
3196         If the value does not match the name of any existing tablespace,
3197         <productname>PostgreSQL</> will automatically use the default
3198         tablespace of the current database.
3199        </para>
3200
3201        <para>
3202         For more information on tablespaces,
3203         see <xref linkend="manage-ag-tablespaces">.
3204        </para>
3205       </listitem>
3206      </varlistentry>
3207
3208      <varlistentry id="guc-check-function-bodies" xreflabel="check_function_bodies">
3209       <term><varname>check_function_bodies</varname> (<type>boolean</type>)</term>
3210       <indexterm>
3211        <primary><varname>check_function_bodies</> configuration parameter</primary>
3212       </indexterm>
3213       <listitem>
3214        <para>
3215         This parameter is normally on. When set to <literal>off</>, it
3216         disables validation of the function body string during <xref
3217         linkend="sql-createfunction"
3218         endterm="sql-createfunction-title">. Disabling validation is
3219         occasionally useful to avoid problems such as forward references
3220         when restoring function definitions from a dump.
3221        </para>
3222       </listitem>
3223      </varlistentry>
3224
3225      <varlistentry id="guc-default-transaction-isolation" xreflabel="default_transaction_isolation">
3226       <indexterm>
3227        <primary>transaction isolation level</primary>
3228       </indexterm>
3229       <indexterm>
3230        <primary><varname>default_transaction_isolation</> configuration parameter</primary>
3231       </indexterm>
3232       <term><varname>default_transaction_isolation</varname> (<type>string</type>)</term>
3233       <listitem>
3234        <para>
3235         Each SQL transaction has an isolation level, which can be
3236         either <quote>read uncommitted</quote>, <quote>read
3237         committed</quote>, <quote>repeatable read</quote>, or
3238         <quote>serializable</quote>.  This parameter controls the
3239         default isolation level of each new transaction. The default
3240         is <quote>read committed</quote>.
3241        </para>
3242
3243        <para>
3244         Consult <xref linkend="mvcc"> and <xref
3245         linkend="sql-set-transaction"
3246         endterm="sql-set-transaction-title"> for more information.
3247        </para>
3248       </listitem>
3249      </varlistentry>
3250
3251      <varlistentry id="guc-default-transaction-read-only" xreflabel="default_transaction_read_only">
3252       <indexterm>
3253        <primary>read-only transaction</primary>
3254       </indexterm>
3255       <indexterm>
3256        <primary><varname>default_transaction_read_only</> configuration parameter</primary>
3257       </indexterm>
3258
3259       <term><varname>default_transaction_read_only</varname> (<type>boolean</type>)</term>
3260       <listitem>
3261        <para>
3262         A read-only SQL transaction cannot alter non-temporary tables.
3263         This parameter controls the default read-only status of each new
3264         transaction. The default is <literal>off</> (read/write).
3265        </para>
3266
3267        <para>
3268         Consult <xref linkend="sql-set-transaction"
3269         endterm="sql-set-transaction-title"> for more information.
3270        </para>
3271       </listitem>
3272      </varlistentry>
3273      
3274      <varlistentry id="guc-statement-timeout" xreflabel="statement_timeout">
3275       <term><varname>statement_timeout</varname> (<type>integer</type>)</term>
3276       <indexterm>
3277        <primary><varname>statement_timeout</> configuration parameter</primary>
3278       </indexterm>
3279       <listitem>
3280        <para>
3281         Abort any statement that takes over the specified number of
3282         milliseconds.  If <varname>log_min_error_statement</> is set to
3283         <literal>ERROR</> or lower, the statement that timed out will also be
3284         logged.  A value of zero (the default) turns off the 
3285         limitation.
3286        </para>
3287       </listitem>
3288      </varlistentry>
3289      
3290      </variablelist>
3291     </sect2>
3292      <sect2 id="runtime-config-client-format">
3293      <title>Locale and Formatting</title>
3294
3295      <variablelist>
3296
3297      <varlistentry id="guc-datestyle" xreflabel="DateStyle">
3298       <term><varname>DateStyle</varname> (<type>string</type>)</term>
3299       <indexterm>
3300        <primary><varname>DateStyle</> configuration parameter</primary>
3301       </indexterm>
3302       <listitem>
3303        <para>
3304         Sets the display format for date and time values, as well as the
3305         rules for interpreting ambiguous date input values. For
3306         historical reasons, this variable contains two independent
3307         components: the output format specification (<literal>ISO</>,
3308         <literal>Postgres</>, <literal>SQL</>, or <literal>German</>)
3309         and the input/output specification for year/month/day ordering
3310         (<literal>DMY</>, <literal>MDY</>, or <literal>YMD</>). These
3311         can be set separately or together. The keywords <literal>Euro</>
3312         and <literal>European</> are synonyms for <literal>DMY</>; the
3313         keywords <literal>US</>, <literal>NonEuro</>, and
3314         <literal>NonEuropean</> are synonyms for <literal>MDY</>. See
3315         <xref linkend="datatype-datetime"> for more information. The
3316         built-in default is <literal>ISO, MDY</>, but
3317         <application>initdb</application> will initialize the
3318         configuration file with a setting that corresponds to the
3319         behavior of the chosen <varname>lc_time</varname> locale.
3320        </para>
3321       </listitem>
3322      </varlistentry>
3323
3324      <varlistentry id="guc-timezone" xreflabel="timezone">
3325       <term><varname>timezone</varname> (<type>string</type>)</term>
3326       <indexterm>
3327        <primary><varname>timezone</> configuration parameter</primary>
3328       </indexterm>
3329       <indexterm><primary>time zone</></>
3330       <listitem>
3331        <para>
3332         Sets the time zone for displaying and interpreting time
3333         stamps.  The default is 'unknown', which means to use whatever 
3334         the system environment specifies as the time zone.  See <xref
3335         linkend="datatype-datetime"> for more information.
3336        </para>
3337       </listitem>
3338      </varlistentry>
3339
3340      <varlistentry id="guc-australian-timezones" xreflabel="australian_timezones">
3341       <term><varname>australian_timezones</varname> (<type>boolean</type>)</term>
3342       <indexterm>
3343        <primary><varname>australian_timezones</> configuration parameter</primary>
3344       </indexterm>
3345       <indexterm><primary>time zone</><secondary>Australian</></>
3346       <listitem>
3347        <para>
3348         If set to on, <literal>ACST</literal>,
3349         <literal>CST</literal>, <literal>EST</literal>, and
3350         <literal>SAT</literal> are interpreted as Australian time
3351         zones rather than as North/South American time zones and
3352         Saturday. The default is <literal>off</>.
3353        </para>
3354       </listitem>
3355      </varlistentry>
3356
3357      <varlistentry id="guc-extra-float-digits" xreflabel="extra_float_digits">
3358       <indexterm>
3359        <primary>significant digits</primary>
3360       </indexterm>
3361       <indexterm>
3362        <primary>floating-point</primary>
3363        <secondary>display</secondary>
3364       </indexterm>
3365       <indexterm>
3366        <primary><varname>extra_float_digits</> configuration parameter</primary>
3367       </indexterm>
3368
3369       <term><varname>extra_float_digits</varname> (<type>integer</type>)</term>
3370       <listitem>
3371        <para>
3372         This parameter adjusts the number of digits displayed for
3373         floating-point values, including <type>float4</>, <type>float8</>,
3374         and geometric data types.  The parameter value is added to the
3375         standard number of digits (<literal>FLT_DIG</> or <literal>DBL_DIG</>
3376         as appropriate).  The value can be set as high as 2, to include
3377         partially-significant digits; this is especially useful for dumping
3378         float data that needs to be restored exactly.  Or it can be set
3379         negative to suppress unwanted digits.
3380        </para>
3381       </listitem>
3382      </varlistentry>
3383
3384      <varlistentry id="guc-client-encoding" xreflabel="client_encoding">
3385       <term><varname>client_encoding</varname> (<type>string</type>)</term>
3386       <indexterm>
3387        <primary><varname>client_encoding</> configuration parameter</primary>
3388       </indexterm>
3389       <indexterm><primary>character set</></>
3390       <listitem>
3391        <para>
3392         Sets the client-side encoding (character set).
3393         The default is to use the database encoding.
3394        </para>
3395       </listitem>
3396      </varlistentry>
3397
3398      <varlistentry id="guc-lc-messages" xreflabel="lc_messages">
3399       <term><varname>lc_messages</varname> (<type>string</type>)</term>
3400       <indexterm>
3401        <primary><varname>lc_messages</> configuration parameter</primary>
3402       </indexterm>
3403       <listitem>
3404        <para>
3405         Sets the language in which messages are displayed.  Acceptable
3406         values are system-dependent; see <xref linkend="locale"> for
3407         more information.  If this variable is set to the empty string
3408         (which is the default) then the value is inherited from the
3409         execution environment of the server in a system-dependent way.
3410        </para>
3411
3412        <para>
3413         On some systems, this locale category does not exist.  Setting
3414         this variable will still work, but there will be no effect.
3415         Also, there is a chance that no translated messages for the
3416         desired language exist.  In that case you will continue to see
3417         the English messages.
3418        </para>
3419
3420        <para>
3421         Only superusers can change this setting, because it affects the
3422         messages sent to the postmaster log as well as to the client.
3423        </para>
3424       </listitem>
3425      </varlistentry>
3426
3427      <varlistentry id="guc-lc-monetary" xreflabel="lc_monetary">
3428       <term><varname>lc_monetary</varname> (<type>string</type>)</term>
3429       <indexterm>
3430        <primary><varname>lc_monetary</> configuration parameter</primary>
3431       </indexterm>
3432       <listitem>
3433        <para>
3434         Sets the locale to use for formatting monetary amounts, for
3435         example with the <function>to_char</function> family of
3436         functions.  Acceptable values are system-dependent; see <xref
3437         linkend="locale"> for more information.  If this variable is
3438         set to the empty string (which is the default) then the value
3439         is inherited from the execution environment of the server in a
3440         system-dependent way.
3441        </para>
3442       </listitem>
3443      </varlistentry>
3444
3445      <varlistentry id="guc-lc-numeric" xreflabel="lc_numeric">
3446       <term><varname>lc_numeric</varname> (<type>string</type>)</term>
3447       <indexterm>
3448        <primary><varname>lc_numeric</> configuration parameter</primary>
3449       </indexterm>
3450       <listitem>
3451        <para>
3452         Sets the locale to use for formatting numbers, for example
3453         with the <function>to_char</function> family of
3454         functions. Acceptable values are system-dependent; see <xref
3455         linkend="locale"> for more information.  If this variable is
3456         set to the empty string (which is the default) then the value
3457         is inherited from the execution environment of the server in a
3458         system-dependent way.
3459        </para>
3460       </listitem>
3461      </varlistentry>
3462
3463      <varlistentry id="guc-lc-time" xreflabel="lc_time">
3464       <term><varname>lc_time</varname> (<type>string</type>)</term>
3465       <indexterm>
3466        <primary><varname>lc_time</> configuration parameter</primary>
3467       </indexterm>
3468       <listitem>
3469        <para>
3470         Sets the locale to use for formatting date and time values.
3471         (Currently, this setting does nothing, but it may in the
3472         future.)  Acceptable values are system-dependent; see <xref
3473         linkend="locale"> for more information.  If this variable is
3474         set to the empty string (which is the default) then the value
3475         is inherited from the execution environment of the server in a
3476         system-dependent way.
3477        </para>
3478       </listitem>
3479      </varlistentry>
3480
3481      </variablelist>
3482
3483     </sect2>
3484      <sect2 id="runtime-config-client-other">
3485      <title>Other Defaults</title>
3486
3487      <variablelist>
3488
3489      <varlistentry id="guc-explain-pretty-print" xreflabel="explain_pretty_print">
3490       <term><varname>explain_pretty_print</varname> (<type>boolean</type>)</term>
3491       <indexterm>
3492        <primary><varname>explain_pretty_print</> configuration parameter</primary>
3493       </indexterm>
3494       <listitem>
3495        <para>
3496         Determines whether <command>EXPLAIN VERBOSE</> uses the
3497         indented or non-indented format for displaying detailed
3498         query-tree dumps. The default is <literal>on</>.
3499        </para>
3500       </listitem>
3501      </varlistentry>
3502
3503      <varlistentry id="guc-dynamic-library-path" xreflabel="dynamic_library_path">
3504       <term><varname>dynamic_library_path</varname> (<type>string</type>)</term>
3505       <indexterm>
3506        <primary><varname>dynamic_library_path</> configuration parameter</primary>
3507       </indexterm>
3508       <indexterm><primary>dynamic loading</></>
3509       <listitem>
3510        <para>
3511         If a dynamically loadable module needs to be opened and the
3512         file name specified in the <command>CREATE FUNCTION</command> or
3513         <command>LOAD</command> command
3514         does not have a directory component (i.e. the
3515         name does not contain a slash), the system will search this
3516         path for the required file.
3517        </para>
3518
3519        <para>
3520         The value for <varname>dynamic_library_path</varname> has to be a
3521         list of absolute directory paths separated by colons (or semi-colons
3522         on Windows).  If a list element starts
3523         with the special string <literal>$libdir</literal>, the
3524         compiled-in <productname>PostgreSQL</productname> package
3525         library directory is substituted for <literal>$libdir</literal>. This
3526         is where the modules provided by the standard
3527         <productname>PostgreSQL</productname> distribution are installed.
3528         (Use <literal>pg_config --pkglibdir</literal> to find out the name of
3529         this directory.) For example:
3530 <programlisting>
3531 dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
3532 </programlisting>
3533         or, in a Windows environment:
3534 <programlisting>
3535 dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
3536 </programlisting>
3537        </para>
3538
3539        <para>
3540         The default value for this parameter is
3541         <literal>'$libdir'</literal>. If the value is set to an empty
3542         string, the automatic path search is turned off.
3543        </para>
3544
3545        <para>
3546         This parameter can be changed at run time by superusers, but a
3547         setting done that way will only persist until the end of the
3548         client connection, so this method should be reserved for
3549         development purposes. The recommended way to set this parameter
3550         is in the <filename>postgresql.conf</filename> configuration
3551         file.
3552        </para>
3553       </listitem>
3554      </varlistentry>
3555
3556      </variablelist>
3557     </sect2>
3558    </sect1>
3559
3560    <sect1 id="runtime-config-locks">
3561     <title>Lock Management</title>
3562
3563      <variablelist>
3564
3565      <varlistentry id="guc-deadlock-timeout" xreflabel="deadlock_timeout">
3566       <indexterm>
3567        <primary>deadlock</primary>
3568        <secondary>timeout during</secondary>
3569       </indexterm>
3570       <indexterm>
3571        <primary>timeout</primary>
3572        <secondary>deadlock</secondary>
3573       </indexterm>
3574       <indexterm>
3575        <primary><varname>deadlock_timeout</> configuration parameter</primary>
3576       </indexterm>
3577
3578       <term><varname>deadlock_timeout</varname> (<type>integer</type>)</term>
3579       <listitem>
3580        <para>
3581         This is the amount of time, in milliseconds, to wait on a lock
3582         before checking to see if there is a deadlock condition. The
3583         check for deadlock is relatively slow, so the server doesn't run
3584         it every time it waits for a lock. We (optimistically?) assume
3585         that deadlocks are not common in production applications and
3586         just wait on the lock for a while before starting the check for a
3587         deadlock. Increasing this value reduces the amount of time
3588         wasted in needless deadlock checks, but slows down reporting of
3589         real deadlock errors. The default is 1000 (i.e., one second),
3590         which is probably about the smallest value you would want in
3591         practice. On a heavily loaded server you might want to raise it.
3592         Ideally the setting should exceed your typical transaction time,
3593         so as to improve the odds that a lock will be released before
3594         the waiter decides to check for deadlock.
3595        </para>
3596       </listitem>
3597      </varlistentry>
3598
3599      <varlistentry id="guc-max-locks-per-transaction" xreflabel="max_locks_per_transaction">
3600       <term><varname>max_locks_per_transaction</varname> (<type>integer</type>)</term>
3601       <indexterm>
3602        <primary><varname>max_locks_per_transaction</> configuration parameter</primary>
3603       </indexterm>
3604       <listitem>
3605        <para>
3606         The shared lock table is created with room to describe locks on
3607         <varname>max_locks_per_transaction</varname> *
3608         (<xref linkend="guc-max-connections"> +
3609         <xref linkend="guc-max-prepared-transactions">) objects;
3610         hence, no more than this many distinct objects can
3611         be locked at any one time. (Thus, this parameter's name may be
3612         confusing: it is not a hard limit on the number of locks taken
3613         by any one transaction, but rather a maximum average value.)
3614         The default, 64, has historically
3615         proven sufficient, but you might need to raise this value if you
3616         have clients that touch many different tables in a single
3617         transaction. This parameter can only be set at server start.
3618        </para>
3619
3620        <para>
3621         Increasing this parameter may cause <productname>PostgreSQL</>
3622         to request more <systemitem class="osname">System V</> shared
3623         memory than your operating system's default configuration
3624         allows. See <xref linkend="sysvipc"> for information on how to
3625         adjust those parameters, if necessary.
3626        </para>
3627       </listitem>
3628      </varlistentry>
3629
3630      </variablelist>
3631    </sect1>
3632
3633    <sect1 id="runtime-config-compatible">
3634     <title>Version and Platform Compatibility</title>
3635
3636     <sect2 id="runtime-config-compatible-version">
3637      <title>Previous PostgreSQL Versions</title>
3638
3639      <variablelist>
3640
3641      <varlistentry id="guc-add-missing-from" xreflabel="add_missing_from">
3642       <term><varname>add_missing_from</varname> (<type>boolean</type>)</term>
3643       <indexterm><primary>FROM</><secondary>missing</></>
3644       <indexterm>
3645        <primary><varname>add_missing_from</> configuration parameter</primary>
3646       </indexterm>
3647       <listitem>
3648        <para>
3649         When on, tables that are referenced by a query will be
3650         automatically added to the <literal>FROM</> clause if not
3651         already present. This behavior does not comply with the SQL
3652         standard and many people dislike it because it can mask mistakes
3653         (such as referencing a table where you should have referenced
3654         its alias). The default is <literal>off</>. This variable can be
3655         enabled for compatibility with releases of
3656         <productname>PostgreSQL</> prior to 8.1, where this behavior was
3657         allowed by default.
3658        </para>
3659
3660        <para>
3661         Note that even when this variable is enabled, a warning
3662         message will be emitted for each implicit <literal>FROM</>
3663         entry referenced by a query. Users are encouraged to update
3664         their applications to not rely on this behavior, by adding all
3665         tables referenced by a query to the query's <literal>FROM</>
3666         clause (or its <literal>USING</> clause in the case of
3667         <command>DELETE</>).
3668        </para>
3669       </listitem>
3670      </varlistentry>
3671
3672      <varlistentry id="guc-array-nulls" xreflabel="array_nulls">
3673       <term><varname>array_nulls</varname> (<type>boolean</type>)</term>
3674       <indexterm>
3675        <primary><varname>array_nulls</> configuration parameter</primary>
3676       </indexterm>
3677       <listitem>
3678        <para>
3679         This controls whether the array input parser recognizes
3680         unquoted <literal>NULL</> as specifying a NULL array element.
3681         By default, this is <literal>on</>, allowing array values containing
3682         NULLs to be entered.  However, <productname>PostgreSQL</> versions
3683         before 8.2 did not support NULLs in arrays, and therefore would
3684         treat <literal>NULL</> as specifying a normal array element with
3685         the string value <quote>NULL</>.  For backwards compatibility with
3686         applications that require the old behavior, this variable can be
3687         turned <literal>off</>.
3688        </para>
3689
3690        <para>
3691         Note that it is possible to create array values containing NULLs
3692         even when this variable is <literal>off</>.
3693        </para>
3694       </listitem>
3695      </varlistentry>
3696
3697      <varlistentry id="guc-default-with-oids" xreflabel="default_with_oids">
3698       <term><varname>default_with_oids</varname> (<type>boolean</type>)</term>
3699       <indexterm>
3700        <primary><varname>default_with_oids</> configuration parameter</primary>
3701       </indexterm>
3702       <listitem>
3703        <para>
3704         This controls whether <command>CREATE TABLE</command> and
3705         <command>CREATE TABLE AS</command> include an OID column in
3706         newly-created tables, if neither <literal>WITH OIDS</literal>
3707         nor <literal>WITHOUT OIDS</literal> is specified. It also
3708         determines whether OIDs will be included in tables created by
3709         <command>SELECT INTO</command>. In <productname>PostgreSQL</>
3710         8.1 <varname>default_with_oids</> is disabled by default; in
3711         prior versions of <productname>PostgreSQL</productname>, it
3712         was on by default.
3713        </para>
3714
3715        <para>
3716         The use of OIDs in user tables is considered deprecated, so
3717         most installations should leave this variable disabled.
3718         Applications that require OIDs for a particular table should
3719         specify <literal>WITH OIDS</literal> when creating the
3720         table. This variable can be enabled for compatibility with old
3721         applications that do not follow this behavior.
3722        </para>
3723       </listitem>
3724      </varlistentry>
3725
3726      <varlistentry id="guc-escape-string-warning" xreflabel="escape_string_warning">
3727       <term><varname>escape_string_warning</varname> (<type>boolean</type>)</term>
3728       <indexterm><primary>strings</><secondary>escape</></>
3729       <indexterm>
3730        <primary><varname>escape_string_warning</> configuration parameter</primary>
3731       </indexterm>
3732       <listitem>
3733        <para>
3734         When on, a warning is issued if a backslash (<literal>\</>)
3735         appears in an ordinary string literal (<literal>'...'</>
3736         syntax). The default is <literal>on</>.
3737        </para>
3738        <para>
3739         Escape string syntax (<literal>E'...'</>) should be used for
3740         backslash escape sequences, because ordinary strings have
3741         the standard-conforming behavior of treating backslashes
3742         literally when the <literal>standard-conforming-strings</>
3743         option is set <literal>on</>.
3744        </para>
3745       </listitem>
3746      </varlistentry>
3747
3748      <varlistentry id="guc-standard-conforming-strings" xreflabel="standard_conforming_strings">
3749       <term><varname>standard_conforming_strings</varname> (<type>boolean</type>)</term>
3750       <indexterm><primary>strings</><secondary>escape</></>
3751       <indexterm>
3752        <primary><varname>standard_conforming_strings</> configuration parameter</primary>
3753       </indexterm>
3754       <listitem>
3755        <para>
3756         Controls whether ordinary string literals
3757         (<literal>'...'</>) treat backslashes literally, as specified in
3758         the SQL standard.  Applications may check this
3759         parameter to determine how string literals will be processed.
3760         The presence of this parameter can also be taken as an indication
3761         that the escape string syntax (<literal>E'...'</>) is supported.
3762        </para>
3763       </listitem>
3764      </varlistentry>
3765
3766      <varlistentry id="guc-regex-flavor" xreflabel="regex_flavor">
3767       <term><varname>regex_flavor</varname> (<type>string</type>)</term>
3768       <indexterm><primary>regular expressions</></>
3769       <indexterm>
3770        <primary><varname>regex_flavor</> configuration parameter</primary>
3771       </indexterm>
3772       <listitem>
3773        <para>
3774         The regular expression <quote>flavor</> can be set to
3775         <literal>advanced</>, <literal>extended</>, or <literal>basic</>.
3776         The default is <literal>advanced</>.  The <literal>extended</>
3777         setting may be useful for exact backwards compatibility with
3778         pre-7.4 releases of <productname>PostgreSQL</>.  See
3779         <xref linkend="posix-syntax-details"> for details.
3780        </para>
3781       </listitem>
3782      </varlistentry>
3783
3784      <varlistentry id="guc-sql-inheritance" xreflabel="sql_inheritance">
3785       <term><varname>sql_inheritance</varname> (<type>boolean</type>)</term>
3786       <indexterm>
3787        <primary><varname>sql_inheritance</> configuration parameter</primary>
3788       </indexterm>
3789       <indexterm><primary>inheritance</></>
3790       <listitem>
3791        <para>
3792         This controls the inheritance semantics, in particular whether
3793         subtables are included by various commands by default. They were
3794         not included in versions prior to 7.1. If you need the old
3795         behavior you can set this variable to <literal>off</>, but in
3796         the long run you are encouraged to change your applications to
3797         use the <literal>ONLY</literal> key word to exclude subtables.
3798         See <xref linkend="ddl-inherit"> for more information about
3799         inheritance.
3800        </para>
3801       </listitem>
3802      </varlistentry>
3803
3804      </variablelist>
3805     </sect2>
3806
3807     <sect2 id="runtime-config-compatible-clients">
3808      <title>Platform and Client Compatibility</title>
3809      <variablelist>
3810
3811      <varlistentry id="guc-transform-null-equals" xreflabel="transform_null_equals">
3812       <term><varname>transform_null_equals</varname> (<type>boolean</type>)</term>
3813       <indexterm><primary>IS NULL</></>
3814       <indexterm>
3815        <primary><varname>transform_null_equals</> configuration parameter</primary>
3816       </indexterm>
3817       <listitem>
3818        <para>
3819         When on, expressions of the form <literal><replaceable>expr</> =
3820         NULL</literal> (or <literal>NULL =
3821         <replaceable>expr</></literal>) are treated as
3822         <literal><replaceable>expr</> IS NULL</literal>, that is, they
3823         return true if <replaceable>expr</> evaluates to the null value,
3824         and false otherwise. The correct SQL-spec-compliant behavior of
3825         <literal><replaceable>expr</> = NULL</literal> is to always
3826         return null (unknown). Therefore this parameter defaults to
3827         <literal>off</>.
3828        </para>
3829
3830        <para>
3831         However, filtered forms in <productname>Microsoft
3832         Access</productname> generate queries that appear to use
3833         <literal><replaceable>expr</> = NULL</literal> to test for
3834         null values, so if you use that interface to access the database you
3835         might want to turn this option on.  Since expressions of the
3836         form <literal><replaceable>expr</> = NULL</literal> always
3837         return the null value (using the correct interpretation) they are not
3838         very useful and do not appear often in normal applications, so
3839         this option does little harm in practice.  But new users are
3840         frequently confused about the semantics of expressions
3841         involving null values, so this option is not on by default.
3842        </para>
3843
3844        <para>
3845         Note that this option only affects the exact form <literal>= NULL</>,
3846         not other comparison operators or other expressions
3847         that are computationally equivalent to some expression
3848         involving the equals operator (such as <literal>IN</literal>).
3849         Thus, this option is not a general fix for bad programming.
3850        </para>
3851
3852        <para>
3853         Refer to <xref linkend="functions-comparison"> for related information.
3854        </para>
3855       </listitem>
3856      </varlistentry>
3857
3858      </variablelist>
3859     </sect2>
3860    </sect1>
3861
3862    <sect1 id="runtime-config-preset">
3863     <title>Preset Options</title>
3864
3865     <para>
3866      The following <quote>parameters</> are read-only, and are determined
3867      when <productname>PostgreSQL</productname> is compiled or when it is
3868      installed. As such, they have been excluded from the sample
3869      <filename>postgresql.conf</> file.  These options report
3870      various aspects of <productname>PostgreSQL</productname> behavior
3871      that may be of interest to certain applications, particularly
3872      administrative front-ends.
3873     </para>
3874
3875     <variablelist>
3876
3877      <varlistentry id="guc-block-size" xreflabel="block_size">
3878       <term><varname>block_size</varname> (<type>integer</type>)</term>
3879       <indexterm>
3880        <primary><varname>block_size</> configuration parameter</primary>
3881       </indexterm>
3882       <listitem>
3883        <para>
3884         Reports the size of a disk block.  It is determined by the value
3885         of <literal>BLCKSZ</> when building the server. The default
3886         value is 8192 bytes.  The meaning of some configuration
3887         variables (such as <xref linkend="guc-shared-buffers">) is
3888         influenced by <varname>block_size</varname>. See <xref
3889         linkend="runtime-config-resource"> for information.
3890        </para>
3891       </listitem>
3892      </varlistentry>
3893
3894      <varlistentry id="guc-integer-datetimes" xreflabel="integer_datetimes">
3895       <term><varname>integer_datetimes</varname> (<type>boolean</type>)</term>
3896       <indexterm>
3897        <primary><varname>integer_datetimes</> configuration parameter</primary>
3898       </indexterm>
3899       <listitem>
3900        <para>
3901         Reports whether <productname>PostgreSQL</productname> was built
3902         with support for 64-bit-integer dates and times.  It is set by
3903         configuring with <literal>--enable-integer-datetimes</literal>
3904         when building <productname>PostgreSQL</productname>.  The
3905         default value is <literal>off</literal>.
3906        </para>
3907       </listitem>
3908      </varlistentry>
3909
3910      <varlistentry id="guc-lc-collate" xreflabel="lc_collate">
3911       <term><varname>lc_collate</varname> (<type>string</type>)</term>
3912       <indexterm>
3913        <primary><varname>lc_collate</> configuration parameter</primary>
3914       </indexterm>
3915       <listitem>
3916        <para>
3917         Reports the locale in which sorting of textual data is done.
3918         See <xref linkend="locale"> for more information.
3919         The value is determined when the database cluster is initialized.
3920        </para>
3921       </listitem>
3922      </varlistentry>
3923
3924      <varlistentry id="guc-lc-ctype" xreflabel="lc_ctype">
3925       <term><varname>lc_ctype</varname> (<type>string</type>)</term>
3926       <indexterm>
3927        <primary><varname>lc_ctype</> configuration parameter</primary>
3928       </indexterm>
3929       <listitem>
3930        <para>
3931         Reports the locale that determines character classifications.
3932         See <xref linkend="locale"> for more information.
3933         The value is determined when the database cluster is initialized.
3934         Ordinarily this will be the same as <varname>lc_collate</varname>,
3935         but for special applications it might be set differently.
3936        </para>
3937       </listitem>
3938      </varlistentry>
3939
3940      <varlistentry id="guc-max-function-args" xreflabel="max_function_args">
3941       <term><varname>max_function_args</varname> (<type>integer</type>)</term>
3942       <indexterm>
3943        <primary><varname>max_function_args</> configuration parameter</primary>
3944       </indexterm>
3945       <listitem>
3946        <para>
3947         Reports the maximum number of function arguments. It is determined by
3948         the value of <literal>FUNC_MAX_ARGS</> when building the server. The
3949         default value is 100.
3950        </para>
3951       </listitem>
3952      </varlistentry>
3953
3954      <varlistentry id="guc-max-identifier-length" xreflabel="max_identifier_length">
3955       <term><varname>max_identifier_length</varname> (<type>integer</type>)</term>
3956       <indexterm>
3957        <primary><varname>max_identifier_length</> configuration parameter</primary>
3958       </indexterm>
3959       <listitem>
3960        <para>
3961         Reports the maximum identifier length. It is determined as one
3962         less than the value of <literal>NAMEDATALEN</> when building
3963         the server. The default value of <literal>NAMEDATALEN</> is
3964         64; therefore the default
3965         <varname>max_identifier_length</varname> is 63.
3966        </para>
3967       </listitem>
3968      </varlistentry>
3969
3970      <varlistentry id="guc-max-index-keys" xreflabel="max_index_keys">
3971       <term><varname>max_index_keys</varname> (<type>integer</type>)</term>
3972       <indexterm>
3973        <primary><varname>max_index_keys</> configuration parameter</primary>
3974       </indexterm>
3975       <listitem>
3976        <para>
3977         Reports the maximum number of index keys. It is determined by
3978         the value of <literal>INDEX_MAX_KEYS</> when building the server. The
3979         default value is 32.
3980        </para>
3981       </listitem>
3982      </varlistentry>
3983
3984      <varlistentry id="guc-server-encoding" xreflabel="server_encoding">
3985       <term><varname>server_encoding</varname> (<type>string</type>)</term>
3986       <indexterm>
3987        <primary><varname>server_encoding</> configuration parameter</primary>
3988       </indexterm>
3989       <indexterm><primary>character set</></>
3990       <listitem>
3991        <para>
3992         Reports the database encoding (character set).
3993         It is determined when the database is created.  Ordinarily,
3994         clients need only be concerned with the value of <xref
3995         linkend="guc-client-encoding">.
3996        </para>
3997       </listitem>
3998      </varlistentry>
3999
4000      <varlistentry id="guc-server-version" xreflabel="server_version">
4001       <term><varname>server_version</varname> (<type>string</type>)</term>
4002       <indexterm>
4003        <primary><varname>server_version</> configuration parameter</primary>
4004       </indexterm>
4005       <listitem>
4006        <para>
4007         Reports the version number of the server. It is determined by the
4008         value of <literal>PG_VERSION</> when building the server.
4009        </para>
4010       </listitem>
4011      </varlistentry>
4012
4013     </variablelist>
4014    </sect1>
4015
4016    <sect1 id="runtime-config-custom">
4017     <title>Customized Options</title>
4018
4019     <para>
4020      This feature was designed to allow parameters not normally known to
4021      <productname>PostgreSQL</productname> to be added by add-on modules
4022      (such as procedural languages).  This allows add-on modules to be
4023      configured in the standard ways.
4024     </para>
4025
4026     <variablelist>
4027
4028      <varlistentry id="guc-custom-variable-classes" xreflabel="custom_variable_classes">
4029       <term><varname>custom_variable_classes</varname> (<type>string</type>)</term>
4030       <indexterm>
4031        <primary><varname>custom_variable_classes</> configuration parameter</primary>
4032       </indexterm>
4033       <listitem>
4034        <para>
4035         This variable specifies one or several class names to be used for
4036         custom variables, in the form of a comma-separated list. A custom
4037         variable is a variable not normally known
4038         to <productname>PostgreSQL</productname> proper but used by some
4039         add-on module.  Such variables must have names consisting of a class
4040         name, a dot, and a variable name.  <varname>custom_variable_classes</>
4041         specifies all the class names in use in a particular installation.
4042         This parameter can only be set in the <filename>postgresql.conf</>
4043         file or on the server command line.
4044        </para>
4045
4046       </listitem>
4047      </varlistentry>
4048     </variablelist>
4049
4050     <para>
4051      The difficulty with setting custom variables in
4052      <filename>postgresql.conf</> is that the file must be read before add-on
4053      modules have been loaded, and so custom variables would ordinarily be
4054      rejected as unknown.  When <varname>custom_variable_classes</> is set,
4055      the server will accept definitions of arbitrary variables within each
4056      specified class.  These variables will be treated as placeholders and
4057      will have no function until the module that defines them is loaded. When a
4058      module for a specific class is loaded, it will add the proper variable
4059      definitions for its class name, convert any placeholder
4060      values according to those definitions, and issue warnings for any
4061      placeholders of its class that remain (which presumably would be
4062      misspelled configuration variables).
4063     </para>
4064
4065     <para>
4066      Here is an example of what <filename>postgresql.conf</> might contain
4067      when using custom variables:
4068
4069 <programlisting>
4070 custom_variable_classes = 'plr,plperl'
4071 plr.path = '/usr/lib/R'
4072 plperl.use_strict = true
4073 plruby.use_strict = true        # generates error: unknown class name
4074 </programlisting>
4075     </para>
4076    </sect1>
4077
4078    <sect1 id="runtime-config-developer">
4079     <title>Developer Options</title>
4080
4081     <para>
4082      The following parameters are intended for work on the
4083      <productname>PostgreSQL</productname> source, and in some cases
4084      to assist with recovery of severely damaged databases.  There
4085      should be no reason to use them in a production database setup.
4086      As such, they have been excluded from the sample
4087      <filename>postgresql.conf</> file.  Note that many of these
4088      parameters require special source compilation flags to work at all.
4089     </para>
4090
4091     <variablelist>
4092      <varlistentry id="guc-allow-system-table-mods" xreflabel="allow_system_table_mods">
4093       <term><varname>allow_system_table_mods</varname> (<type>boolean</type>)</term>
4094       <indexterm>
4095         <primary><varname>allow_system_table_mods</varname> configuration parameter</primary>
4096       </indexterm>
4097       <listitem>
4098        <para>
4099         Allows modification of the structure of system tables.
4100         This is used by <command>initdb</command>.
4101         This parameter can only be set at server start.
4102        </para>
4103       </listitem>
4104      </varlistentry>
4105
4106      <varlistentry id="guc-debug-assertions" xreflabel="debug_assertions">
4107       <term><varname>debug_assertions</varname> (<type>boolean</type>)</term>
4108       <indexterm>
4109        <primary><varname>debug_assertions</> configuration parameter</primary>
4110       </indexterm>
4111       <listitem>
4112        <para>
4113         Turns on various assertion checks. This is a debugging aid. If
4114         you are experiencing strange problems or crashes you might want
4115         to turn this on, as it might expose programming mistakes. To use
4116         this parameter, the macro <symbol>USE_ASSERT_CHECKING</symbol>
4117         must be defined when <productname>PostgreSQL</productname> is
4118         built (accomplished by the <command>configure</command> option
4119         <option>--enable-cassert</option>). Note that
4120         <varname>debug_assertions</varname> defaults to <literal>on</>
4121         if <productname>PostgreSQL</productname> has been built with
4122         assertions enabled.
4123        </para>
4124       </listitem>
4125      </varlistentry>
4126
4127      <varlistentry id="guc-ignore-system-indexes" xreflabel="ignore_system_indexes">
4128       <term><varname>ignore_system_indexes</varname> (<type>boolean</type>)</term>
4129       <indexterm>
4130         <primary><varname>ignore_system_indexes</varname> configuration parameter</primary>
4131       </indexterm>
4132       <listitem>
4133        <para>
4134         Ignore system indexes when reading system tables (but still
4135         update the indexes when modifying the tables).  This is useful
4136         when recovering from damaged system indexes.
4137         This parameter cannot be changed after session start.
4138        </para>
4139       </listitem>
4140      </varlistentry>
4141
4142      <varlistentry id="guc-post-auth-delay" xreflabel="post_auth_delay">
4143       <term><varname>post_auth_delay</varname> (<type>integer</type>)</term>
4144       <indexterm>
4145        <primary><varname>post_auth_delay</> configuration parameter</primary>
4146       </indexterm>
4147       <listitem>
4148        <para>
4149         If nonzero, a delay of this many seconds occurs when a new
4150         server process is started, after it conducts the
4151         authentication procedure.  This is intended to give an
4152         opportunity to attach to the server process with a debugger.
4153         This parameter cannot be changed after session start.
4154        </para>
4155       </listitem>
4156      </varlistentry>
4157
4158      <varlistentry id="guc-pre-auth-delay" xreflabel="pre_auth_delay">
4159       <term><varname>pre_auth_delay</varname> (<type>integer</type>)</term>
4160       <indexterm>
4161        <primary><varname>pre_auth_delay</> configuration parameter</primary>
4162       </indexterm>
4163       <listitem>
4164        <para>
4165         If nonzero, a delay of this many seconds occurs just after a
4166         new server process is forked, before it conducts the
4167         authentication procedure.  This is intended to give an
4168         opportunity to attach to the server process with a debugger to
4169         trace down misbehavior in authentication.
4170         This parameter can only be set in the <filename>postgresql.conf</>
4171         file or on the server command line.
4172        </para>
4173       </listitem>
4174      </varlistentry>
4175
4176      <varlistentry id="guc-trace-notify" xreflabel="trace_notify">
4177       <term><varname>trace_notify</varname> (<type>boolean</type>)</term>
4178       <indexterm>
4179        <primary><varname>trace_notify</> configuration parameter</primary>
4180       </indexterm>
4181       <listitem>
4182        <para>
4183         Generates a great amount of debugging output for the
4184         <command>LISTEN</command> and <command>NOTIFY</command>
4185         commands.  <xref linkend="guc-client-min-messages"> or
4186         <xref linkend="guc-log-min-messages"> must be
4187         <literal>DEBUG1</literal> or lower to send this output to the
4188         client or server log, respectively.
4189        </para>
4190       </listitem>
4191      </varlistentry>
4192
4193      <varlistentry id="guc-trace-sort" xreflabel="trace_sort">
4194       <term><varname>trace_sort</varname> (<type>boolean</type>)</term>
4195       <indexterm>
4196        <primary><varname>trace_sort</> configuration parameter</primary>
4197       </indexterm>
4198       <listitem>
4199        <para>
4200         If on, emit information about resource usage during sort operations.
4201         This parameter is only available if the <symbol>TRACE_SORT</symbol> macro
4202         was defined when <productname>PostgreSQL</productname> was compiled.
4203         (However, <symbol>TRACE_SORT</symbol> is currently defined by default.)
4204        </para>
4205       </listitem>
4206      </varlistentry>
4207
4208      <varlistentry>
4209       <term><varname>trace_locks</varname> (<type>boolean</type>)</term>
4210       <term><varname>trace_lwlocks</varname> (<type>boolean</type>)</term>
4211       <term><varname>trace_userlocks</varname> (<type>boolean</type>)</term>
4212       <term><varname>trace_lock_oidmin</varname> (<type>boolean</type>)</term>
4213       <term><varname>trace_lock_table</varname> (<type>boolean</type>)</term>
4214       <term><varname>debug_deadlocks</varname> (<type>boolean</type>)</term>
4215       <term><varname>log_btree_build_stats</varname> (<type>boolean</type>)</term>
4216       <listitem>
4217        <para>
4218         Various other code tracing and debugging options.
4219        </para>
4220       </listitem>
4221      </varlistentry>
4222
4223      <varlistentry id="guc-wal-debug" xreflabel="wal_debug">
4224       <term><varname>wal_debug</varname> (<type>boolean</type>)</term>
4225       <indexterm>
4226        <primary><varname>wal_debug</> configuration parameter</primary>
4227       </indexterm>
4228       <listitem>
4229        <para>
4230         If on, emit WAL-related debugging output. This parameter is
4231         only available if the <symbol>WAL_DEBUG</symbol> macro was
4232         defined when <productname>PostgreSQL</productname> was
4233         compiled.
4234        </para>
4235       </listitem>
4236      </varlistentry>
4237
4238     <varlistentry id="guc-zero-damaged-pages" xreflabel="zero_damaged_pages">
4239       <term><varname>zero_damaged_pages</varname> (<type>boolean</type>)</term>
4240       <indexterm>
4241        <primary><varname>zero_damaged_pages</> configuration parameter</primary>
4242       </indexterm>
4243       <listitem>
4244        <para>
4245         Detection of a damaged page header normally causes
4246         <productname>PostgreSQL</> to report an error, aborting the current
4247         command.  Setting <varname>zero_damaged_pages</> to on causes
4248         the system to instead report a warning, zero out the damaged page,
4249         and continue processing.  This behavior <emphasis>will destroy data</>,
4250         namely all the rows on the damaged page.  But it allows you to get
4251         past the error and retrieve rows from any undamaged pages that may
4252         be present in the table.  So it is useful for recovering data if
4253         corruption has occurred due to hardware or software error.  You should
4254         generally not set this on until you have given up hope of recovering
4255         data from the damaged page(s) of a table.  The
4256         default setting is <literal>off</>, and it can only be changed
4257         by a superuser.
4258        </para>
4259       </listitem>
4260      </varlistentry>
4261    </variablelist>
4262   </sect1>
4263   <sect1 id="runtime-config-short">
4264    <title>Short Options</title>
4265
4266    <para>
4267     For convenience there are also single letter command-line option
4268     switches available for some parameters.  They are described in
4269     <xref linkend="runtime-config-short-table">.  Some of these
4270     options exist for historical reasons, and their presence as a
4271     single-letter option does not necessarily indicate an endorsement
4272     to use the option heavily.
4273    </para>
4274
4275     <table id="runtime-config-short-table">
4276      <title>Short option key</title>
4277      <tgroup cols="2">
4278       <thead>
4279        <row>
4280         <entry>Short option</entry>
4281         <entry>Equivalent</entry>
4282        </row>
4283       </thead>
4284
4285       <tbody>
4286        <row>
4287         <entry><option>-A <replaceable>x</replaceable></option></entry>
4288         <entry><literal>debug_assertions = <replaceable>x</replaceable></></entry>
4289        </row>
4290        <row>
4291         <entry><option>-B <replaceable>x</replaceable></option></entry>
4292         <entry><literal>shared_buffers = <replaceable>x</replaceable></></entry>
4293        </row>
4294        <row>
4295         <entry><option>-d <replaceable>x</replaceable></option></entry>
4296         <entry><literal>log_min_messages = DEBUG<replaceable>x</replaceable></></entry>
4297        </row>
4298        <row>
4299         <entry><option>-e</option></entry>
4300         <entry><literal>datestyle = euro</></entry>
4301        </row>
4302        <row>
4303         <entry>
4304           <option>-fb</option>, <option>-fh</option>, <option>-fi</option>,
4305           <option>-fm</option>, <option>-fn</option>,
4306           <option>-fs</option>, <option>-ft</option>
4307          </entry>
4308          <entry>
4309           <literal>enable_bitmapscan = off</>,
4310           <literal>enable_hashjoin = off</>,
4311           <literal>enable_indexscan = off</>,
4312           <literal>enable_mergejoin = off</>,
4313           <literal>enable_nestloop = off</>,
4314           <literal>enable_seqscan = off</>,
4315           <literal>enable_tidscan = off</>
4316          </entry>
4317        </row>
4318        <row>
4319         <entry><option>-F</option></entry>
4320         <entry><literal>fsync = off</></entry>
4321        </row>
4322        <row>
4323         <entry><option>-h <replaceable>x</replaceable></option></entry>
4324         <entry><literal>listen_addresses = <replaceable>x</replaceable></></entry>
4325        </row>
4326        <row>
4327         <entry><option>-i</option></entry>
4328         <entry><literal>listen_addresses = '*'</></entry>
4329        </row>
4330        <row>
4331         <entry><option>-k <replaceable>x</replaceable></option></entry>
4332         <entry><literal>unix_socket_directory = <replaceable>x</replaceable></></entry>
4333        </row>
4334        <row>
4335         <entry><option>-l</option></entry>
4336         <entry><literal>ssl = on</></entry>
4337        </row>
4338        <row>
4339         <entry><option>-N <replaceable>x</replaceable></option></entry>
4340         <entry><literal>max_connections = <replaceable>x</replaceable></></entry>
4341        </row>
4342        <row>
4343         <entry><option>-O</option></entry>
4344         <entry><literal>allow_system_table_mods = on</></entry>
4345        </row>
4346        <row>
4347         <entry><option>-p <replaceable>x</replaceable></option></entry>
4348         <entry><literal>port = <replaceable>x</replaceable></></entry>
4349        </row>
4350        <row>
4351         <entry><option>-P</option></entry>
4352         <entry><literal>ignore_system_indexes = on</></entry>
4353        </row>
4354        <row>
4355         <entry><option>-s</option></entry>
4356         <entry><literal>log_statement_stats = on</></entry>
4357        </row>
4358        <row>
4359         <entry><option>-S <replaceable>x</replaceable></option></entry>
4360         <entry><literal>work_mem = <replaceable>x</replaceable></></entry>
4361        </row>
4362        <row>
4363         <entry><option>-tpa</option>, <option>-tpl</option>, <option>-te</option></entry>
4364         <entry><literal>log_parser_stats = on</>,
4365         <literal>log_planner_stats = on</>, 
4366         <literal>log_executor_stats = on</></entry>
4367        </row>
4368        <row>
4369         <entry><option>-W <replaceable>x</replaceable></option></entry>
4370         <entry><literal>post_auth_delay = <replaceable>x</replaceable></></entry>
4371        </row>
4372       </tbody>
4373      </tgroup>
4374     </table>
4375
4376   </sect1>
4377 </chapter>
4378
4379 <!-- Keep this comment at the end of the file
4380 Local variables:
4381 mode:sgml
4382 sgml-omittag:nil
4383 sgml-shorttag:t
4384 sgml-minimize-attributes:nil
4385 sgml-always-quote-attributes:t
4386 sgml-indent-step:1
4387 sgml-indent-data:t
4388 sgml-parent-document:nil
4389 sgml-default-dtd-file:"./reference.ced"
4390 sgml-exposed-tags:nil
4391 sgml-local-catalogs:("/usr/lib/sgml/catalog")
4392 sgml-local-ecat-files:nil
4393 End:
4394 -->