↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / System Catalogs

pg_hba_file_rules

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. 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 current contents of the file, not on what was last loaded by the server. By default, the pg_hba_file_rules view can be read only by superusers.

English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

kind
view
lang
en
measured attributes
true
metadata release
18.6
runtime columns
rule_number, file_name, line_number, type, database, user_name, address, netmask, auth_method, options, error
runtime verified
false
source
english-manual

Definition PG 18

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. 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 current contents of the file, not on what was last loaded by the server. By default, the pg_hba_file_rules view can be read only by superusers.

Catalog columns

ColumnTypeNullabilityDescription
rule_numberint4NullableNumber 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_nametextNullableName of the file containing this rule
line_numberint4NullableLine number of this rule in file_name
typetextNullableType of connection
databasetext[]NullableList of database name(s) to which this rule applies
user_nametext[]NullableList of user and group name(s) to which this rule applies
addresstextNullableHost name or IP address, or one of all, samehost, or samenet, or null for local connections
netmasktextNullableIP address mask, or null if not applicable
auth_methodtextNullableAuthentication method
optionstext[]NullableOptions specified for authentication method, if any
errortextNullableIf not null, an error message indicating why this line could not be processed

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · catalog-bilingual-repair:2cf4afc9f2088b8165d178395356c654d06de6014f37bd753c8a183495b0886e

Text language: en · catalog-bilingual-repair:2cf4afc9f2088b8165d178395356c654d06de6014f37bd753c8a183495b0886e