Postgresql 中文操作指南
54.9. pg_hba_file_rules #
视图 pg_hba_file_rules 提供客户端身份验证配置文件 pg_hba.conf 内容的摘要。文件中的每行非空、非注释都会在此视图中显示一行,带注释以指示是否成功应用了规则。
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.
此视图有助于检查身份验证配置文件中的计划更改是否有效,或者诊断以前遇到的故障。请注意,此视图报告文件中的 current 内容,而不是服务器上次加载的内容。
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.
默认情况下,pg_hba_file_rules 视图只能由超级用户读取。
By default, the pg_hba_file_rules view can be read only by superusers.
Table 54.9. pg_hba_file_rules Columns
Table 54.9. pg_hba_file_rules Columns
Column Type Description |
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 |
通常,反映错误输入的行将仅包含 line_number 和 error 字段的值。
Usually, a row reflecting an incorrect entry will have values for only the line_number and error fields.
有关客户端认证配置的更多信息,请参见 Chapter 21。
See Chapter 21 for more information about client authentication configuration.