Home Explore Blog CI



postgresql

14th chunk of `doc/src/sgml/system-views.sgml`
0f8defa144bb37b03f4a657bfcfa320e26be6750c9ecfe700000000100000fa0
 <type>oid</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       ID of this group
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>grolist</structfield> <type>oid[]</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       An array containing the IDs of the roles in this group
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-hba-file-rules">
  <title><structname>pg_hba_file_rules</structname></title>

  <indexterm zone="view-pg-hba-file-rules">
   <primary>pg_hba_file_rules</primary>
  </indexterm>

  <para>
   The view <structname>pg_hba_file_rules</structname> provides a summary of
   the contents of the client authentication configuration file,
   <link linkend="auth-pg-hba-conf"><filename>pg_hba.conf</filename></link>.
   A row appears in this view for each
   non-empty, non-comment line in the file, with annotations indicating
   whether the rule could be applied successfully.
  </para>

  <para>
   This view can be helpful for checking whether planned changes in the
   authentication configuration file will work, or for diagnosing a previous
   failure.  Note that this view reports on the <emphasis>current</emphasis> contents
   of the file, not on what was last loaded by the server.
  </para>

  <para>
   By default, the <structname>pg_hba_file_rules</structname> view can be read
   only by superusers.
  </para>

  <table>
   <title><structname>pg_hba_file_rules</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>rule_number</structfield> <type>int4</type>
      </para>
      <para>
       Number of this rule, if valid, otherwise <literal>NULL</literal>.
       This indicates the order in which each rule is considered
       until a match is found during authentication.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>file_name</structfield> <type>text</type>
      </para>
      <para>
       Name of the file containing this rule
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>line_number</structfield> <type>int4</type>
      </para>
      <para>
       Line number of this rule in <literal>file_name</literal>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>type</structfield> <type>text</type>
      </para>
      <para>
       Type of connection
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>database</structfield> <type>text[]</type>
      </para>
      <para>
       List of database name(s) to which this rule applies
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>user_name</structfield> <type>text[]</type>
      </para>
      <para>
       List of user and group name(s) to which this rule applies
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>address</structfield> <type>text</type>
      </para>
      <para>
       Host name or IP address, or one
       of <literal>all</literal>, <literal>samehost</literal>,
     

Title: pg_hba_file_rules View
Summary
The pg_hba_file_rules view provides a summary of the client authentication configuration file, pg_hba.conf. It shows each non-empty, non-comment line in the file, with annotations indicating whether the rule could be applied successfully. The view includes columns such as rule number, file name, line number, connection type, database names, user names, and address. This view can be helpful for checking planned changes or diagnosing previous failures in the authentication configuration, but it can only be read by superusers by default.