pg_hba_file_rules — PostgreSQL system view

The PostgreSQL pg_hba_file_rules system view: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

The view pg_hba_file_rules provides a summary of the contents of the client authentication configuration file, pg_hba.conf. 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.

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_hba_file_rules system view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • rule_number int4
    Number of this rule, if valid, otherwise NULL. This indicates the order in which each rule is considered until a match is found during authentication.
  • file_name text
    Name of the file containing this rule
  • line_number int4
    Line number of this rule in file_name
  • type text
    Type of connection
  • database text[]
    List of database name(s) to which this rule applies
  • user_name text[]
    List of user and group name(s) to which this rule applies
  • address text
    Host name or IP address, or one of all, samehost, or samenet, or null for local connections
  • netmask text
    IP address mask, or null if not applicable
  • auth_method text
    Authentication method
  • options text[]
    Options specified for authentication method, if any
  • error text
    If not null, an error message indicating why this line could not be processed

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_hba_file_rules.