]> begriffs open source - ai-pg/blob - full-docs/txt/runtime-config-file-locations.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / runtime-config-file-locations.txt
1
2 19.2. File Locations #
3
4    In addition to the postgresql.conf file already mentioned, PostgreSQL
5    uses two other manually-edited configuration files, which control
6    client authentication (their use is discussed in Chapter 20). By
7    default, all three configuration files are stored in the database
8    cluster's data directory. The parameters described in this section
9    allow the configuration files to be placed elsewhere. (Doing so can
10    ease administration. In particular it is often easier to ensure that
11    the configuration files are properly backed-up when they are kept
12    separate.)
13
14    data_directory (string) #
15           Specifies the directory to use for data storage. This parameter
16           can only be set at server start.
17
18    config_file (string) #
19           Specifies the main server configuration file (customarily called
20           postgresql.conf). This parameter can only be set on the postgres
21           command line.
22
23    hba_file (string) #
24           Specifies the configuration file for host-based authentication
25           (customarily called pg_hba.conf). This parameter can only be set
26           at server start.
27
28    ident_file (string) #
29           Specifies the configuration file for user name mapping
30           (customarily called pg_ident.conf). This parameter can only be
31           set at server start. See also Section 20.2.
32
33    external_pid_file (string) #
34           Specifies the name of an additional process-ID (PID) file that
35           the server should create for use by server administration
36           programs. This parameter can only be set at server start.
37
38    In a default installation, none of the above parameters are set
39    explicitly. Instead, the data directory is specified by the -D
40    command-line option or the PGDATA environment variable, and the
41    configuration files are all found within the data directory.
42
43    If you wish to keep the configuration files elsewhere than the data
44    directory, the postgres -D command-line option or PGDATA environment
45    variable must point to the directory containing the configuration
46    files, and the data_directory parameter must be set in postgresql.conf
47    (or on the command line) to show where the data directory is actually
48    located. Notice that data_directory overrides -D and PGDATA for the
49    location of the data directory, but not for the location of the
50    configuration files.
51
52    If you wish, you can specify the configuration file names and locations
53    individually using the parameters config_file, hba_file and/or
54    ident_file. config_file can only be specified on the postgres command
55    line, but the others can be set within the main configuration file. If
56    all three parameters plus data_directory are explicitly set, then it is
57    not necessary to specify -D or PGDATA.
58
59    When setting any of these parameters, a relative path will be
60    interpreted with respect to the directory in which postgres is started.