> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/12/internals/system-catalogs/pg_hba_file_rules.md).

# 51.72. 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 51.73. `pg_hba_file_rules` Columns**

| Name          | Type      | Description                                                                                       |
| ------------- | --------- | ------------------------------------------------------------------------------------------------- |
| `line_number` | `integer` | Line number of this rule in `pg_hba.conf`                                                         |
| `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.

有關用戶端身份驗證設定的更多資訊，請參閱[第 20 章](/12/server-administration/client-authentication.md)。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/12/internals/system-catalogs/pg_hba_file_rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
