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
| Column | Type | Nullability | Description |
|---|---|---|---|
| rule_number | int4 | Nullable | 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 | Nullable | Name of the file containing this rule |
| line_number | int4 | Nullable | Line number of this rule in file_name |
| type | text | Nullable | Type of connection |
| database | text[] | Nullable | List of database name(s) to which this rule applies |
| user_name | text[] | Nullable | List of user and group name(s) to which this rule applies |
| address | text | Nullable | Host name or IP address, or one of all, samehost, or samenet, or null for local connections |
| netmask | text | Nullable | IP address mask, or null if not applicable |
| auth_method | text | Nullable | Authentication method |
| options | text[] | Nullable | Options specified for authentication method, if any |
| error | text | Nullable | If 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