> 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/the-sql-language/functions/functions-info/functions-info-wal-summary.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 9.27.12. WAL 摘要資訊函式

## 9.27.12. WAL 摘要資訊函式 [#](#functions-info-wal-summary) <a href="#functions-info-wal-summary" id="functions-info-wal-summary"></a>

[表 9.94](#functions-wal-summary) 所列的函式會輸出 WAL 摘要的狀態資訊。請參閱 [summarize\_wal](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-wal.md#GUC-SUMMARIZE-WAL)。

### 表 9.94. WAL 摘要資訊函式 [#](#functions-wal-summary) <a href="#functions-wal-summary" id="functions-wal-summary"></a>

| <p>函式</p><p>說明</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>pg\_available\_wal\_summaries</code> () → <code>setof record</code> ( <em><code>tli</code></em> <code>bigint</code>, <em><code>start\_lsn</code></em> <code>pg\_lsn</code>, <em><code>end\_lsn</code></em> <code>pg\_lsn</code> )</p><p>回傳資料目錄中 <code>pg\_wal/summaries</code> 底下現有 WAL 摘要檔的資訊。每個 WAL 摘要檔會回傳一筆資料列。每個檔案摘要了指定 TLI 上、指定 LSN 範圍內的 WAL。這個函式可用來判斷伺服器上是否存在足夠的 WAL 摘要，以便根據某個起始 LSN 已知的先前備份來進行增量備份。</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><code>pg\_wal\_summary\_contents</code> ( <em><code>tli</code></em> <code>bigint</code>, <em><code>start\_lsn</code></em> <code>pg\_lsn</code>, <em><code>end\_lsn</code></em> <code>pg\_lsn</code> ) → <code>setof record</code> ( <em><code>relfilenode</code></em> <code>oid</code>, <em><code>reltablespace</code></em> <code>oid</code>, <em><code>reldatabase</code></em> <code>oid</code>, <em><code>relforknumber</code></em> <code>smallint</code>, <em><code>relblocknumber</code></em> <code>bigint</code>, <em><code>is\_limit\_block</code></em> <code>boolean</code> )</p><p>回傳由 TLI 以及起始與結束 LSN 所識別之單一 WAL 摘要檔的內容資訊。<code>is\_limit\_block</code> 為 false 的每一筆資料列，表示由其餘輸出欄位所識別的區塊，在這個檔案所摘要的紀錄範圍內至少被一筆 WAL 紀錄修改過。<code>is\_limit\_block</code> 為 true 的每一筆資料列，則表示：(a) 該關聯的 fork 在相關的 WAL 紀錄範圍內被截斷為 <code>relblocknumber</code> 所給定的長度，或者 (b) 該關聯的 fork 在相關的 WAL 紀錄範圍內被建立或刪除；在後者的情況下，<code>relblocknumber</code> 會是零。</p>                                                                |
| <p><code>pg\_get\_wal\_summarizer\_state</code> () → <code>record</code> ( <em><code>summarized\_tli</code></em> <code>bigint</code>, <em><code>summarized\_lsn</code></em> <code>pg\_lsn</code>, <em><code>pending\_lsn</code></em> <code>pg\_lsn</code>, <em><code>summarizer\_pid</code></em> <code>int</code> )</p><p>回傳 WAL 摘要程序（WAL summarizer）進度的資訊。如果自執行個體啟動以來 WAL 摘要程序從未執行過，則 <code>summarized\_tli</code> 與 <code>summarized\_lsn</code> 分別為 <code>0</code> 與 <code>0/0</code>；否則，它們會是最後一個寫入磁碟之 WAL 摘要檔的 TLI 與結束 LSN。如果 WAL 摘要程序目前正在執行，<code>pending\_lsn</code> 會是它最後處理完之紀錄的結束 LSN，其值必定大於或等於 <code>summarized\_lsn</code>；如果 WAL 摘要程序沒有在執行，它會等於 <code>summarized\_lsn</code>。<code>summarizer\_pid</code> 是 WAL 摘要程序的 PID（如果它正在執行），否則為 NULL。</p><p>作為特殊的例外，如果 WAL 是在 <code>wal\_level=minimal</code> 設定下產生的，WAL 摘要程序會拒絕為其產生 WAL 摘要檔，因為這樣的摘要若作為增量備份的基礎並不安全。在這種情況下，上述欄位仍會像正在產生摘要一樣持續推進，但不會有任何內容寫入磁碟。一旦摘要程序處理到 <code>wal\_level</code> 設定為 <code>replica</code> 或更高層級時所產生的 WAL，它就會恢復將摘要寫入磁碟。</p> |

<br>

[返回 9.27. 系統資訊函式與運算子](https://docs.postgresql.tw/19/the-sql-language/functions/functions-info.md#functions-info)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/functions-info.html)（原文版本：18.6；核對日期：2026-09-11）


---

# 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/the-sql-language/functions/functions-info/functions-info-wal-summary.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.
