53.9. pg_hba_file_rules #

В представлении pg_hba_file_rules показывается сводное содержимое файла конфигурации аутентификации клиентов, pg_hba.conf. Для каждой непустой и незакомментированной строки в этом файле данное представление содержит одну строку с отметкой, показывающей, может ли это правило быть успешно применено.

Это представление может быть полезно для проверки, будут ли работать планируемые изменения в файле конфигурации аутентификации, или для диагностики возникшей проблемы. Заметьте, что в этом представлении отражается текущее содержимое файла, а не то, что было загружено сервером в последний раз.

По умолчанию представление pg_hba_file_rules доступно только суперпользователям и только для чтения.

Таблица 53.9. Столбцы pg_hba_file_rules

Тип столбца

Описание

rule_number int4

Номер правила, если оно рабочее. В противном случае — NULL. Таким образом указывается порядок, в котором рассматривается каждое правило во время аутентификации до того, пока не будет найдено соответствие

file_name text

Имя файла, содержащего это правило

line_number int4

Номер строки этого правила в file_name

type text

Тип подключения

database text[]

Список имён баз данных, к которым применяется это правило

user_name text[]

Список имён пользователей и групп, к которым применяется это правило

address text

Имя или IP-адрес узла либо одно из значений: all, samehost или samenet, либо NULL для локальных подключений

netmask text

Маска IP-адреса либо NULL, если это неприменимо

auth_method text

Метод аутентификации

options text[]

Параметры, задаваемые для метода аутентификации (если они есть)

error text

Сообщение об ошибке, говорящее, почему эта строка не может быть обработана, либо NULL


Обычно строка, отражающая некорректную запись, будет содержать значения только в полях line_number и error.

Чтобы узнать больше о конфигурации аутентификации клиентов, обратитесь к Главе 19.

53.9. 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.

Table 53.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


Usually, a row reflecting an incorrect entry will have values for only the line_number and error fields.

See Chapter 19 for more information about client authentication configuration.

FAQ