Home Explore Blog CI



postgresql

8th chunk of `doc/src/sgml/config.sgml`
ad800d5440ab8464341bf3337650b4b5b83fefe8959569000000000100000fa2
 Locations</title>

     <para>
      In addition to the <filename>postgresql.conf</filename> file
      already mentioned, <productname>PostgreSQL</productname> uses
      two other manually-edited configuration files, which control
      client authentication (their use is discussed in <xref
      linkend="client-authentication"/>).  By default, all three
      configuration files are stored in the database cluster's data
      directory.  The parameters described in this section allow the
      configuration files to be placed elsewhere.  (Doing so can ease
      administration.  In particular it is often easier to ensure that
      the configuration files are properly backed-up when they are
      kept separate.)
     </para>

     <variablelist>
     <varlistentry id="guc-data-directory" xreflabel="data_directory">
      <term><varname>data_directory</varname> (<type>string</type>)
      <indexterm>
       <primary><varname>data_directory</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
         Specifies the directory to use for data storage.
         This parameter can only be set at server start.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="guc-config-file" xreflabel="config_file">
      <term><varname>config_file</varname> (<type>string</type>)
      <indexterm>
       <primary><varname>config_file</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
         Specifies the main server configuration file
         (customarily called <filename>postgresql.conf</filename>).
         This parameter can only be set on the <command>postgres</command> command line.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="guc-hba-file" xreflabel="hba_file">
      <term><varname>hba_file</varname> (<type>string</type>)
      <indexterm>
       <primary><varname>hba_file</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
         Specifies the configuration file for host-based authentication
         (customarily called <filename>pg_hba.conf</filename>).
         This parameter can only be set at server start.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="guc-ident-file" xreflabel="ident_file">
      <term><varname>ident_file</varname> (<type>string</type>)
      <indexterm>
       <primary><varname>ident_file</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
         Specifies the configuration file for user name mapping
         (customarily called <filename>pg_ident.conf</filename>).
         This parameter can only be set at server start.
         See also <xref linkend="auth-username-maps"/>.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry id="guc-external-pid-file" xreflabel="external_pid_file">
      <term><varname>external_pid_file</varname> (<type>string</type>)
      <indexterm>
       <primary><varname>external_pid_file</varname> configuration parameter</primary>
      </indexterm>
      </term>
      <listitem>
       <para>
        Specifies the name of an additional process-ID (PID) file that the
        server should create for use by server administration programs.
        This parameter can only be set at server start.
       </para>
      </listitem>
     </varlistentry>
     </variablelist>

     <para>
      In a default installation, none of the above parameters are set
      explicitly.  Instead, the
      data directory is specified by the <option>-D</option> command-line
      option or the <envar>PGDATA</envar> environment variable, and the
      configuration files are all found within the data directory.
     </para>

     <para>
      If you wish to keep the configuration files elsewhere than the
      data directory, the <command>postgres</command> <option>-D</option>

Title: PostgreSQL File Locations and Configuration Parameters
Summary
This section details the file locations used by PostgreSQL, including the main configuration file (postgresql.conf) and files controlling client authentication (pg_hba.conf, pg_ident.conf). It describes parameters such as data_directory, config_file, hba_file, ident_file, and external_pid_file, which allow specifying custom locations for these files. It also explains how the -D command-line option and PGDATA environment variable are used to specify the data directory, where configuration files are located by default.