> 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/19/internals/views/view-pg-ident-file-mappings.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 53.11. pg\_ident\_file\_mappings \#

### 53.11. `pg_ident_file_mappings` [#](#view-pg-ident-file-mappings) <a href="#view-pg-ident-file-mappings" id="view-pg-ident-file-mappings"></a>

檢視表 `pg_ident_file_mappings` 提供用戶端使用者名稱對應設定檔 [`pg_ident.conf`](https://docs.postgresql.tw/19/server-administration/client-authentication/auth-username-maps.md) 內容的摘要。檔案中每一個非空白、非註解的行，都會在此檢視表中呈現為一筆資料列，並附有註記，指出該對應能否成功套用。

此檢視表有助於檢查對認證設定檔所規劃的變更是否可行，或診斷先前的失敗。請注意，此檢視表回報的是檔案*目前*的內容，而不是伺服器最後載入的內容。

預設情況下，只有超級使用者可讀取 `pg_ident_file_mappings` 檢視表。

#### 表 53.11. `pg_ident_file_mappings` 欄位 [#](#view-pg-ident-file-mappings-columns) <a href="#view-pg-ident-file-mappings-columns" id="view-pg-ident-file-mappings-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                            |
| ----------------------------------------------------------------------------------------------- |
| <p><code>map\_number</code> <code>int4</code></p><p>若有效，則為此對應依優先順序的編號；否則為 <code>NULL</code></p> |
| <p><code>file\_name</code> <code>text</code></p><p>包含此對應之檔案的名稱</p>                              |
| <p><code>line\_number</code> <code>int4</code></p><p>此對應在 <code>file\_name</code> 中的行號</p>      |
| <p><code>map\_name</code> <code>text</code></p><p>對應名稱</p>                                      |
| <p><code>sys\_name</code> <code>text</code></p><p>偵測到的用戶端使用者名稱</p>                              |
| <p><code>pg\_username</code> <code>text</code></p><p>所要求的 PostgreSQL 使用者名稱</p>                  |
| <p><code>error</code> <code>text</code></p><p>若不為 <code>NULL</code>，則為說明此行為何無法處理的錯誤訊息</p>       |

<br>

通常，反映錯誤項目的資料列只會在 `line_number` 與 `error` 欄位中有值。

關於用戶端認證設定的更多資訊，請參閱[第 20 章](https://docs.postgresql.tw/19/server-administration/client-authentication.md)。

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/view-pg-ident-file-mappings.html)（原文版本：18.6；核對日期：2026-10-09）


---

# 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/19/internals/views/view-pg-ident-file-mappings.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.
