跳转到主要内容
← 目录图谱 / pg_hba_file_rules

SYSTEM VIEW · 系统视图

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.

首次收录 PG 10最近收录 PG 19当前字段 11

已与 PostgreSQL 18.6 实例逐字段核对 · 原始实测记录 ↗

字段结构 PostgreSQL 18

pg_hba_file_rules
字段 / COLUMN类型 / TYPE说明 / DESCRIPTION
rule_number integer文档原写法: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 integer文档原写法: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

标记“隐式列”的字段不包含在 SELECT * 中;部分早期统计视图由同版本源码补全,额外来源会显示在字段说明中。

字段演化矩阵

悬停查看字段类型
存在新增 / 类型或属性变化移除
字段 / COLUMN9.09.19.29.39.49.59.610111213141516171819
line_number
type
database
user_name
address
netmask
auth_method
options
error
rule_number
file_name

9.0 是收录基线;基线中已存在的字段不标记为新增。矩阵按字段名称对齐,重命名显示为旧字段移除与新字段新增。

演化时间线

相邻大版本的变化

PostgreSQL 16 ← 15

+ rule_number+ file_name1 处字段说明更新

PostgreSQL 10 ← 9.6新增目录

+ line_number+ type+ database+ user_name+ address+ netmask+ auth_method+ options+ error

比较任意两个版本

选择两个版本,查看字段的新增、移除与类型变化。交互比较需要 JavaScript;演化时间线可直接阅读。