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_numberint4
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_nametext
Name of the file containing this ruleline_numberint4
Line number of this rule in file_nametypetext
Type of connectiondatabasetext[]
List of database name(s) to which this rule appliesuser_nametext[]
List of user and group name(s) to which this rule appliesaddresstext
Host name or IP address, or one of all, samehost, or samenet, or null for local connectionsnetmasktext
IP address mask, or null if not applicableauth_methodtext
Authentication methodoptionstext[]
Options specified for authentication method, if anyerrortext
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.