~ubuntu-branches/ubuntu/utopic/postgresql-9.4/utopic-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/html/config-setting.html

  • Committer: Package Import Robot
  • Author(s): Martin Pitt, CVE-2014-8161
  • Date: 2015-02-06 12:31:46 UTC
  • mfrom: (1.1.5) (7.1.2 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20150206123146-vtmf30jbkm7w16p8
Tags: 9.4.1-0ubuntu0.14.10
* New upstream security/bug fix release (LP: #1418928)
  - Fix buffer overruns in to_char() [CVE-2015-0241]
  - Fix buffer overruns in contrib/pgcrypto [CVE-2015-0243]
  - Fix possible loss of frontend/backend protocol synchronization after an
    error [CVE-2015-0244]
  - Fix information leak via constraint-violation error messages
    [CVE-2014-8161]
  - See release notes for details about other fixes:
    http://www.postgresql.org/about/news/1569/

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
REV="MADE"
10
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
11
11
REL="HOME"
12
 
TITLE="PostgreSQL 9.4beta3 Documentation"
 
12
TITLE="PostgreSQL 9.4.1 Documentation"
13
13
HREF="index.html"><LINK
14
14
REL="UP"
15
15
TITLE="Server Configuration"
26
26
HTTP-EQUIV="Content-Type"
27
27
CONTENT="text/html; charset=ISO-8859-1"><META
28
28
NAME="creation"
29
 
CONTENT="2014-10-06T18:35:22"></HEAD
 
29
CONTENT="2015-02-02T20:51:01"></HEAD
30
30
><BODY
31
31
CLASS="SECT1"
32
32
><DIV
44
44
VALIGN="bottom"
45
45
><A
46
46
HREF="index.html"
47
 
>PostgreSQL 9.4beta3 Documentation</A
 
47
>PostgreSQL 9.4.1 Documentation</A
48
48
></TH
49
49
></TR
50
50
><TR
105
105
></H2
106
106
><P
107
107
>     All parameter names are case-insensitive. Every parameter takes a
108
 
     value of one of five types: boolean, integer, floating point,
109
 
     string, or enum.
 
108
     value of one of five types: boolean, string, integer, floating point,
 
109
     or enumerated (enum).  The type determines the syntax for setting the
 
110
     parameter:
110
111
    </P
111
112
><P
112
113
></P
119
120
CLASS="EMPHASIS"
120
121
>Boolean:</I
121
122
></SPAN
122
 
> Values can be written as
 
123
>
 
124
       Values can be written as
123
125
       <TT
124
126
CLASS="LITERAL"
125
127
>on</TT
152
154
CLASS="LITERAL"
153
155
>0</TT
154
156
>
155
 
       (all case-insensitive) or any unambiguous prefix of these.
 
157
       (all case-insensitive) or any unambiguous prefix of one of these.
156
158
      </P
157
159
></LI
158
160
><LI
163
165
CLASS="EMPHASIS"
164
166
>String:</I
165
167
></SPAN
166
 
> Enclose the value in
167
 
       single-quotes. Values are case-insensitive.  If multiple values
168
 
       are allowed, separate them with commas.
 
168
>
 
169
       In general, enclose the value in single quotes, doubling any single
 
170
       quotes within the value.  Quotes can usually be omitted if the value
 
171
       is a simple number or identifier, however.
169
172
      </P
170
173
></LI
171
174
><LI
176
179
CLASS="EMPHASIS"
177
180
>Numeric (integer and floating point):</I
178
181
></SPAN
179
 
> Do
180
 
       not use single-quotes (unless otherwise required) or thousand
181
 
       separators.
 
182
>
 
183
       A decimal point is permitted only for floating-point parameters.
 
184
       Do not use thousands separators.  Quotes are not required.
182
185
      </P
183
186
></LI
184
187
><LI
187
190
CLASS="emphasis"
188
191
><I
189
192
CLASS="EMPHASIS"
190
 
>Numeric or String with Unit (Memory &amp;
191
 
       Time):</I
 
193
>Numeric with Unit:</I
192
194
></SPAN
193
 
> These have an implicit unit, which is
194
 
       either kilobytes, blocks (typically eight kilobytes),
195
 
       milliseconds, seconds, or minutes.  A unadorned numeric
196
 
       value will use the default, which can be found by referencing
 
195
>
 
196
       Some numeric parameters have an implicit unit, because they describe
 
197
       quantities of memory or time. The unit might be kilobytes, blocks
 
198
       (typically eight kilobytes), milliseconds, seconds, or minutes.
 
199
       An unadorned numeric value for one of these settings will use the
 
200
       setting's default unit, which can be learned from
197
201
       <TT
198
202
CLASS="STRUCTNAME"
199
203
>pg_settings</TT
200
204
>.<TT
201
205
CLASS="STRUCTFIELD"
202
206
>unit</TT
203
 
>.  For convenience,
204
 
       a different unit can also be specified explicitly via a string
205
 
       value. It is case-sensitive and may include whitespace between
206
 
       the value and the unit.
 
207
>.
 
208
       For convenience, settings can be given with a unit specified explicitly,
 
209
       for example <TT
 
210
CLASS="LITERAL"
 
211
>'120 ms'</TT
 
212
> for a time value, and they will be
 
213
       converted to whatever the parameter's actual unit is.  Note that the
 
214
       value must be written as a string (with quotes) to use this feature.
 
215
       The unit name is case-sensitive, and there can be whitespace between
 
216
       the numeric value and the unit.
207
217
 
208
218
       <P
209
219
></P
260
270
CLASS="emphasis"
261
271
><I
262
272
CLASS="EMPHASIS"
263
 
><SPAN
264
 
CLASS="QUOTE"
265
 
>"enum"</SPAN
266
 
>:</I
 
273
>Enumerated:</I
267
274
></SPAN
268
 
> These are specified
269
 
       in the same way as string parameters, but are restricted
270
 
       to a limited set of values that can be queried from
 
275
>
 
276
       Enumerated-type parameters are written in the same way as string
 
277
       parameters, but are restricted to have one of a limited set of
 
278
       values.  The values allowable for such a parameter can be found from
271
279
       <TT
272
280
CLASS="STRUCTNAME"
273
281
>pg_settings</TT
274
282
>.<TT
275
283
CLASS="STRUCTFIELD"
276
284
>enumvals</TT
277
 
>:
278
 
</P><PRE
279
 
CLASS="PROGRAMLISTING"
280
 
>SELECT name, setting, enumvals FROM pg_settings WHERE enumvals IS NOT NULL;</PRE
281
 
><P>
 
285
>.
282
286
       Enum parameter values are case-insensitive.
283
287
      </P
284
288
></LI
290
294
CLASS="SECT2"
291
295
><A
292
296
NAME="CONFIG-SETTING-CONFIGURATION-FILE"
293
 
>18.1.2. Parameter Interaction via Configuration File</A
 
297
>18.1.2. Parameter Interaction via the Configuration File</A
294
298
></H2
295
299
><P
296
 
>     The primary way to set these parameters is to edit the file
 
300
>     The most fundamental way to set these parameters is to edit the file
297
301
     <TT
298
302
CLASS="FILENAME"
299
303
>postgresql.conf</TT
300
304
>,
301
 
     which is normally kept in the data directory.  (A default copy is
302
 
     installed when the database cluster directory is initialized.)
 
305
     which is normally kept in the data directory.  A default copy is
 
306
     installed when the database cluster directory is initialized.
303
307
     An example of what this file might look like is:
304
308
</P><PRE
305
309
CLASS="PROGRAMLISTING"
310
314
shared_buffers = 128MB</PRE
311
315
><P>
312
316
     One parameter is specified per line. The equal sign between name and
313
 
     value is optional. Whitespace is insignificant and blank lines are
 
317
     value is optional. Whitespace is insignificant (except within a quoted
 
318
     parameter value) and blank lines are
314
319
     ignored. Hash marks (<TT
315
320
CLASS="LITERAL"
316
321
>#</TT
317
322
>) designate the remainder
318
323
     of the line as a comment.  Parameter values that are not simple
319
324
     identifiers or numbers must be single-quoted.  To embed a single
320
 
     quote in a parameter value write either two quotes (preferred)
 
325
     quote in a parameter value, write either two quotes (preferred)
321
326
     or backslash-quote.
322
327
    </P
323
328
><P
324
329
>     Parameters set in this way provide default values for the cluster.
325
 
     The setting seen by active sessions will be this value unless
326
 
     it is overridden.  The following sections describe ways in which the
 
330
     The settings seen by active sessions will be these values unless they
 
331
     are overridden.  The following sections describe ways in which the
327
332
     administrator or user can override these defaults.
328
333
    </P
329
334
><P
332
337
     receives a <SPAN
333
338
CLASS="SYSTEMITEM"
334
339
>SIGHUP</SPAN
335
 
> signal;  this is most easily done by
336
 
     running <TT
 
340
> signal; this signal is most easily
 
341
     sent by running <TT
337
342
CLASS="LITERAL"
338
343
>pg_ctl reload</TT
339
 
> from the command-line or by calling
340
 
     the SQL function <CODE
 
344
> from the command line or by
 
345
     calling the SQL function <CODE
341
346
CLASS="FUNCTION"
342
347
>pg_reload_conf()</CODE
343
348
>. The main
344
349
     server process also propagates this signal to all currently running
345
 
     server processes so that existing sessions also get the new value
346
 
     when they complete their transactions.  Alternatively, you can
 
350
     server processes, so that existing sessions also adopt the new values
 
351
     (this will happen after they complete any currently-executing client
 
352
     command).  Alternatively, you can
347
353
     send the signal to a single server process directly.  Some parameters
348
354
     can only be set at server start; any changes to their entries in the
349
355
     configuration file will be ignored until the server is restarted.
353
359
>SIGHUP</SPAN
354
360
> processing.
355
361
    </P
 
362
><P
 
363
>     In addition to <TT
 
364
CLASS="FILENAME"
 
365
>postgresql.conf</TT
 
366
>,
 
367
     a <SPAN
 
368
CLASS="PRODUCTNAME"
 
369
>PostgreSQL</SPAN
 
370
> data directory contains a file
 
371
     <TT
 
372
CLASS="FILENAME"
 
373
>postgresql.auto.conf</TT
 
374
>,
 
375
     which has the same format as <TT
 
376
CLASS="FILENAME"
 
377
>postgresql.conf</TT
 
378
> but should
 
379
     never be edited manually.  This file holds settings provided through
 
380
     the <A
 
381
HREF="sql-altersystem.html"
 
382
>ALTER SYSTEM</A
 
383
> command.  This file is automatically
 
384
     read whenever <TT
 
385
CLASS="FILENAME"
 
386
>postgresql.conf</TT
 
387
> is, and its settings take
 
388
     effect in the same way.  Settings in <TT
 
389
CLASS="FILENAME"
 
390
>postgresql.auto.conf</TT
 
391
>
 
392
     override those in <TT
 
393
CLASS="FILENAME"
 
394
>postgresql.conf</TT
 
395
>.
 
396
    </P
356
397
></DIV
357
398
><DIV
358
399
CLASS="SECT2"
363
404
>18.1.3. Parameter Interaction via SQL</A
364
405
></H2
365
406
><P
366
 
>       <SPAN
 
407
>      <SPAN
367
408
CLASS="PRODUCTNAME"
368
409
>PostgreSQL</SPAN
369
410
> provides three SQL
370
 
       commands to establish configuration defaults that override those
371
 
       configured globally.  The evaluation of these defaults occurs
372
 
       at the beginning of a new session, upon the user issuing <A
373
 
HREF="sql-discard.html"
374
 
>DISCARD</A
375
 
>, or if the server forces the session to
376
 
       reload its configuration after a <SPAN
377
 
CLASS="SYSTEMITEM"
378
 
>SIGHUP</SPAN
379
 
>
380
 
       signal.
 
411
      commands to establish configuration defaults.
 
412
      The already-mentioned <A
 
413
HREF="sql-altersystem.html"
 
414
>ALTER SYSTEM</A
 
415
> command
 
416
      provides a SQL-accessible means of changing global defaults; it is
 
417
      functionally equivalent to editing <TT
 
418
CLASS="FILENAME"
 
419
>postgresql.conf</TT
 
420
>.
 
421
      In addition, there are two commands that allow setting of defaults
 
422
      on a per-database or per-role basis:
381
423
     </P
382
424
><P
383
425
></P
384
426
><UL
385
427
><LI
386
428
><P
387
 
>        The <A
388
 
HREF="sql-altersystem.html"
389
 
>ALTER SYSTEM</A
390
 
> command provides an
391
 
        SQL-accessible means of changing global defaults.
392
 
      </P
393
 
></LI
394
 
><LI
395
 
><P
396
429
>       The <A
397
430
HREF="sql-alterdatabase.html"
398
431
>ALTER DATABASE</A
399
 
> command allows database
400
 
       administrators to override global settings on a per-database basis.
 
432
> command allows global
 
433
       settings to be overridden on a per-database basis.
401
434
      </P
402
435
></LI
403
436
><LI
405
438
>       The <A
406
439
HREF="sql-alterrole.html"
407
440
>ALTER ROLE</A
408
 
> command allows database
409
 
       administrators to override both global and per-database settings
410
 
       with user-specific values.
 
441
> command allows both global and
 
442
       per-database settings to be overridden with user-specific values.
411
443
      </P
412
444
></LI
413
445
></UL
414
446
><P
415
 
>      Once a client connects to the database PostgreSQL provides
416
 
      two additional SQL commands to interact with session-local
417
 
      configuration settings.  Both of these commands have equivalent
418
 
      system administration functions.
 
447
>      Values set with <TT
 
448
CLASS="COMMAND"
 
449
>ALTER DATABASE</TT
 
450
> and <TT
 
451
CLASS="COMMAND"
 
452
>ALTER ROLE</TT
 
453
>
 
454
      are applied only when starting a fresh database session.  They
 
455
      override values obtained from the configuration files or server
 
456
      command line, and constitute defaults for the rest of the session.
 
457
      Note that some settings cannot be changed after server start, and
 
458
      so cannot be set with these commands (or the ones listed below).
 
459
    </P
 
460
><P
 
461
>      Once a client is connected to the database, <SPAN
 
462
CLASS="PRODUCTNAME"
 
463
>PostgreSQL</SPAN
 
464
>
 
465
      provides two additional SQL commands (and equivalent functions) to
 
466
      interact with session-local configuration settings:
419
467
    </P
420
468
><P
421
469
></P
439
487
HREF="sql-set.html"
440
488
>SET</A
441
489
> command allows modification of the
442
 
       current value of some parameters.  The corresponding function is
 
490
       current value of those parameters that can be set locally to a
 
491
       session; it has no effect on other sessions.
 
492
       The corresponding function is
443
493
       <CODE
444
494
CLASS="FUNCTION"
445
495
>set_config(setting_name, new_value, is_local)</CODE
448
498
></LI
449
499
></UL
450
500
><P
451
 
>     Both <TT
452
 
CLASS="COMMAND"
453
 
>SELECT</TT
454
 
> and <TT
455
 
CLASS="COMMAND"
456
 
>UPDATE</TT
457
 
>
458
 
     can be issued against the system view <A
 
501
>     In addition, the system view <A
459
502
HREF="view-pg-settings.html"
460
503
><TT
461
504
CLASS="STRUCTNAME"
462
505
>pg_settings</TT
463
506
></A
464
 
> to view
465
 
     and change session-local values.
 
507
> can be
 
508
     used to view and change session-local values:
466
509
    </P
467
510
><P
468
511
></P
469
512
><UL
470
513
><LI
471
514
><P
472
 
>       Querying this view is the same as <TT
 
515
>       Querying this view is similar to using <TT
473
516
CLASS="COMMAND"
474
 
>SHOW</TT
475
 
> but provides
476
 
       more detail, as well as allowing for joins against other relations
477
 
       and the specification of filter criteria.
 
517
>SHOW ALL</TT
 
518
> but
 
519
       provides more detail.  It is also more flexible, since it's possible
 
520
       to specify filter conditions or join against other relations.
478
521
      </P
479
522
></LI
480
523
><LI
482
525
>       Using <A
483
526
HREF="sql-update.html"
484
527
>UPDATE</A
485
 
> on this relation, specifically
 
528
> on this view, specifically
486
529
       updating the <TT
487
530
CLASS="STRUCTNAME"
488
531
>setting</TT
489
532
> column, is the equivalent
490
 
       of issuing SQL <TT
 
533
       of issuing <TT
491
534
CLASS="COMMAND"
492
535
>SET</TT
493
 
>, though all values must be
494
 
       single-quoted.  Note that the equivalent of
 
536
> commands.  For example, the equivalent of
495
537
</P><PRE
496
538
CLASS="PROGRAMLISTING"
497
539
>SET configuration_parameter TO DEFAULT;</PRE
498
540
><P>
499
 
      is:
 
541
       is:
500
542
</P><PRE
501
543
CLASS="PROGRAMLISTING"
502
544
>UPDATE pg_settings SET setting = reset_val WHERE name = 'configuration_parameter';</PRE
503
545
><P>
504
 
    </P
 
546
      </P
505
547
></LI
506
548
></UL
507
549
></DIV
510
552
><H2
511
553
CLASS="SECT2"
512
554
><A
513
 
NAME="AEN29253"
514
 
>18.1.4. Parameter Interaction via Shell</A
 
555
NAME="AEN29452"
 
556
>18.1.4. Parameter Interaction via the Shell</A
515
557
></H2
516
558
><P
517
559
>      In addition to setting global defaults or attaching
531
573
><UL
532
574
><LI
533
575
><P
534
 
>       On the <SPAN
535
 
CLASS="emphasis"
536
 
><I
537
 
CLASS="EMPHASIS"
538
 
>server</I
539
 
></SPAN
540
 
>, command-line options can be
 
576
>       During server startup, parameter settings can be
541
577
       passed to the <TT
542
578
CLASS="COMMAND"
543
579
>postgres</TT
544
 
> command directly via the
 
580
> command via the
545
581
       <TT
546
582
CLASS="OPTION"
547
583
>-c</TT
548
 
> parameter.
 
584
> command-line parameter.  For example,
549
585
</P><PRE
550
586
CLASS="PROGRAMLISTING"
551
587
>postgres -c log_connections=yes -c log_destination='syslog'</PRE
552
588
><P>
553
 
       Settings provided this way override those resolved globally (via
 
589
       Settings provided in this way override those set via
554
590
       <TT
555
591
CLASS="FILENAME"
556
592
>postgresql.conf</TT
557
593
> or <TT
558
594
CLASS="COMMAND"
559
595
>ALTER SYSTEM</TT
560
 
>) but
561
 
       are otherwise treated as being global for the purpose of database
562
 
       and role overrides.
 
596
>,
 
597
       so they cannot be changed globally without restarting the server.
563
598
     </P
564
599
></LI
565
600
><LI
566
601
><P
567
 
>      On the <SPAN
568
 
CLASS="emphasis"
569
 
><I
570
 
CLASS="EMPHASIS"
571
 
>libpq-client</I
572
 
></SPAN
573
 
>, command-line options can be
 
602
>      When starting a client session via <SPAN
 
603
CLASS="APPLICATION"
 
604
>libpq</SPAN
 
605
>,
 
606
      parameter settings can be
574
607
      specified using the <TT
575
608
CLASS="ENVAR"
576
609
>PGOPTIONS</TT
577
610
> environment variable.
578
 
      When connecting to the server, the contents of this variable are
579
 
      sent to the server as if they were being executed via SQL <A
580
 
HREF="sql-set.html"
581
 
>SET</A
582
 
> at the beginning of the session.
583
 
     </P
584
 
><P
585
 
>      However, the format of <TT
 
611
      Settings established in this way constitute defaults for the life
 
612
      of the session, but do not affect other sessions.
 
613
      For historical reasons, the format of <TT
586
614
CLASS="ENVAR"
587
615
>PGOPTIONS</TT
588
 
> is similar to that
589
 
      used when launching the <TT
 
616
> is
 
617
      similar to that used when launching the <TT
590
618
CLASS="COMMAND"
591
619
>postgres</TT
592
 
> command.
593
 
      Specifically, the <TT
 
620
>
 
621
      command; specifically, the <TT
594
622
CLASS="OPTION"
595
623
>-c</TT
596
624
> flag must be specified.
 
625
      For example,
597
626
</P><PRE
598
627
CLASS="PROGRAMLISTING"
599
 
>env PGOPTIONS="-c geqo=off -c statement_timeout='5 min'" psql</PRE
 
628
>env PGOPTIONS="-c geqo=off -c statement_timeout=5min" psql</PRE
600
629
><P>
601
630
     </P
602
631
><P
603
632
>      Other clients and libraries might provide their own mechanisms,
604
633
      via the shell or otherwise, that allow the user to alter session
605
 
      settings without requiring the user to issue SQL commands.
 
634
      settings without direct use of SQL commands.
606
635
     </P
607
636
></LI
608
637
></UL
613
642
CLASS="SECT2"
614
643
><A
615
644
NAME="CONFIG-INCLUDES"
616
 
>18.1.5. Configuration File Includes</A
 
645
>18.1.5. Managing Configuration File Contents</A
617
646
></H2
618
647
><P
 
648
>      <SPAN
 
649
CLASS="PRODUCTNAME"
 
650
>PostgreSQL</SPAN
 
651
> provides several features for breaking
 
652
      down complex <TT
 
653
CLASS="FILENAME"
 
654
>postgresql.conf</TT
 
655
> files into sub-files.
 
656
      These features are especially useful when managing multiple servers
 
657
      with related, but not identical, configurations.
 
658
     </P
 
659
><P
619
660
>      
620
 
         In addition to parameter settings, the <TT
 
661
      In addition to individual parameter settings,
 
662
      the <TT
621
663
CLASS="FILENAME"
622
664
>postgresql.conf</TT
623
 
>
624
 
         file can contain <I
 
665
> file can contain <I
625
666
CLASS="FIRSTTERM"
626
 
>include directives</I
627
 
>, which specify
628
 
         another file to read and process as if it were inserted into the
629
 
         configuration file at this point.  This feature allows a configuration
630
 
         file to be divided into physically separate parts.
631
 
         Include directives simply look like:
 
667
>include
 
668
      directives</I
 
669
>, which specify another file to read and process as if
 
670
      it were inserted into the configuration file at this point.  This
 
671
      feature allows a configuration file to be divided into physically
 
672
      separate parts.  Include directives simply look like:
632
673
</P><PRE
633
674
CLASS="PROGRAMLISTING"
634
675
>include 'filename'</PRE
635
676
><P>
636
 
         If the file name is not an absolute path, it is taken as relative to
637
 
         the directory containing the referencing configuration file.
638
 
         Inclusions can be nested.
 
677
      If the file name is not an absolute path, it is taken as relative to
 
678
      the directory containing the referencing configuration file.
 
679
      Inclusions can be nested.
639
680
     </P
640
681
><P
641
682
>      
642
 
         There is also an <TT
 
683
      There is also an <TT
643
684
CLASS="LITERAL"
644
685
>include_if_exists</TT
645
686
> directive, which acts
646
 
         the same as the <TT
 
687
      the same as the <TT
647
688
CLASS="LITERAL"
648
689
>include</TT
649
 
> directive, except for the behavior
650
 
         when the referenced file does not exist or cannot be read.  A regular
651
 
         <TT
 
690
> directive, except
 
691
      when the referenced file does not exist or cannot be read.  A regular
 
692
      <TT
652
693
CLASS="LITERAL"
653
694
>include</TT
654
695
> will consider this an error condition, but
655
 
         <TT
 
696
      <TT
656
697
CLASS="LITERAL"
657
698
>include_if_exists</TT
658
699
> merely logs a message and continues
659
 
         processing the referencing configuration file.
 
700
      processing the referencing configuration file.
660
701
     </P
661
702
><P
662
703
>      
663
 
        The <TT
 
704
      The <TT
664
705
CLASS="FILENAME"
665
706
>postgresql.conf</TT
666
707
> file can also contain
667
 
        <TT
 
708
      <TT
668
709
CLASS="LITERAL"
669
710
>include_dir</TT
670
 
> directives, which specify an entire directory
671
 
        of configuration files to include.  It is used similarly:
 
711
> directives, which specify an entire
 
712
      directory of configuration files to include.  These look like
672
713
</P><PRE
673
714
CLASS="PROGRAMLISTING"
674
715
>include_dir 'directory'</PRE
675
716
><P>
676
 
        Non-absolute directory names follow the same rules as single file include
677
 
        directives:  they are relative to the directory containing the referencing
678
 
        configuration file.  Within that directory, only non-directory files whose
679
 
        names end with the suffix <TT
 
717
      Non-absolute directory names are taken as relative to the directory
 
718
      containing the referencing configuration file.  Within the specified
 
719
      directory, only non-directory files whose names end with the
 
720
      suffix <TT
680
721
CLASS="LITERAL"
681
722
>.conf</TT
682
 
> will be included.  File
683
 
        names that start with the <TT
 
723
> will be included.  File names that
 
724
      start with the <TT
684
725
CLASS="LITERAL"
685
726
>.</TT
686
 
> character are also excluded,
687
 
        to prevent mistakes as they are hidden on some platforms.  Multiple files
688
 
        within an include directory are processed in file name order. The file names
689
 
        are ordered by C locale rules, i.e. numbers before letters, and uppercase
690
 
        letters before lowercase ones.
 
727
> character are also ignored, to
 
728
      prevent mistakes since such files are hidden on some platforms.  Multiple
 
729
      files within an include directory are processed in file name order
 
730
      (according to C locale rules, i.e. numbers before letters, and
 
731
      uppercase letters before lowercase ones).
691
732
     </P
692
733
><P
693
 
>       Include files or directories can be used to logically separate portions
694
 
       of the database configuration, rather than having a single large
695
 
       <TT
 
734
>      Include files or directories can be used to logically separate portions
 
735
      of the database configuration, rather than having a single large
 
736
      <TT
696
737
CLASS="FILENAME"
697
738
>postgresql.conf</TT
698
739
> file.  Consider a company that has two
699
 
       database servers, each with a different amount of memory.  There are likely
700
 
       elements of the configuration both will share, for things such as logging.
701
 
       But memory-related parameters on the server will vary between the two.  And
702
 
       there might be server specific customizations, too.  One way to manage this
703
 
       situation is to break the custom configuration changes for your site into
704
 
       three files.  You could add this to the end of your
705
 
       <TT
 
740
      database servers, each with a different amount of memory.  There are
 
741
      likely elements of the configuration both will share, for things such
 
742
      as logging.  But memory-related parameters on the server will vary
 
743
      between the two.  And there might be server specific customizations,
 
744
      too.  One way to manage this situation is to break the custom
 
745
      configuration changes for your site into three files.  You could add
 
746
      this to the end of your <TT
706
747
CLASS="FILENAME"
707
748
>postgresql.conf</TT
708
 
> file to include them:
 
749
> file to include
 
750
      them:
709
751
</P><PRE
710
752
CLASS="PROGRAMLISTING"
711
753
>include 'shared.conf'
712
754
include 'memory.conf'
713
755
include 'server.conf'</PRE
714
756
><P>
715
 
       All systems would have the same <TT
 
757
      All systems would have the same <TT
716
758
CLASS="FILENAME"
717
759
>shared.conf</TT
718
 
>.  Each server
719
 
       with a particular amount of memory could share the same
720
 
       <TT
 
760
>.  Each
 
761
      server with a particular amount of memory could share the
 
762
      same <TT
721
763
CLASS="FILENAME"
722
764
>memory.conf</TT
723
 
>; you might have one for all servers with 8GB of RAM,
724
 
       another for those having 16GB.  And finally <TT
 
765
>; you might have one for all servers
 
766
      with 8GB of RAM, another for those having 16GB.  And
 
767
      finally <TT
725
768
CLASS="FILENAME"
726
769
>server.conf</TT
727
 
> could
728
 
       have truly server-specific configuration information in it.
 
770
> could have truly server-specific
 
771
      configuration information in it.
729
772
     </P
730
773
><P
731
 
>       Another possibility is to create a configuration file directory and
732
 
       put this information into files there. For example, a <TT
 
774
>      Another possibility is to create a configuration file directory and
 
775
      put this information into files there. For example, a <TT
733
776
CLASS="FILENAME"
734
777
>conf.d</TT
735
778
>
736
 
       directory could be referenced at the end of<TT
 
779
      directory could be referenced at the end of <TT
737
780
CLASS="FILENAME"
738
781
>postgresql.conf</TT
739
782
>:
741
784
CLASS="PROGRAMLISTING"
742
785
>include_dir 'conf.d'</PRE
743
786
><P>
744
 
       Then you could name the files in the <TT
 
787
      Then you could name the files in the <TT
745
788
CLASS="FILENAME"
746
789
>conf.d</TT
747
 
> directory like this:
 
790
> directory
 
791
      like this:
748
792
</P><PRE
749
793
CLASS="PROGRAMLISTING"
750
794
>00shared.conf
751
795
01memory.conf
752
796
02server.conf</PRE
753
797
><P>
754
 
       This shows a clear order in which these files will be loaded.  This is
755
 
       important because only the last setting encountered when the server is
756
 
       reading its configuration will be used.  Something set in
757
 
       <TT
 
798
       This naming convention establishes a clear order in which these
 
799
       files will be loaded.  This is important because only the last
 
800
       setting encountered for a particular parameter while the server is
 
801
       reading configuration files will be used.  In this example,
 
802
       something set in <TT
758
803
CLASS="FILENAME"
759
804
>conf.d/02server.conf</TT
760
 
> in this example would override a value
761
 
       set in <TT
 
805
> would override a
 
806
       value set in <TT
762
807
CLASS="FILENAME"
763
808
>conf.d/01memory.conf</TT
764
809
>.
765
810
     </P
766
811
><P
767
 
>       You might instead use this configuration directory approach while naming
768
 
       these files more descriptively:
 
812
>      You might instead use this approach to naming the files
 
813
      descriptively:
769
814
</P><PRE
770
815
CLASS="PROGRAMLISTING"
771
816
>00shared.conf
772
817
01memory-8GB.conf
773
818
02server-foo.conf</PRE
774
819
><P>
775
 
       This sort of arrangement gives a unique name for each configuration file
776
 
       variation.  This can help eliminate ambiguity when several servers have
777
 
       their configurations all stored in one place, such as in a version
778
 
       control repository.  (Storing database configuration files under version
779
 
       control is another good practice to consider).
 
820
      This sort of arrangement gives a unique name for each configuration file
 
821
      variation.  This can help eliminate ambiguity when several servers have
 
822
      their configurations all stored in one place, such as in a version
 
823
      control repository.  (Storing database configuration files under version
 
824
      control is another good practice to consider.)
780
825
     </P
781
826
></DIV
782
827
></DIV