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

# 28.2. 資料校驗和 \#

### 28.2. 資料校驗和 [#](#checksums) <a href="#checksums" id="checksums"></a>

[28.2.1. 離線啟用校驗和](#checksums-offline-enable-disable)

依預設，資料頁面會受到校驗和（checksum）保護，但也可以選擇針對某個 叢集停用此功能。啟用後，每個資料頁面都會包含一組校驗和， 該校驗和會在頁面寫入時更新，並在每次讀取頁面時進行驗證。只有資料頁面 會受到校驗和保護；內部資料結構與暫存檔案則不會。

校驗和可以在使用 [initdb](https://docs.postgresql.tw/19/reference/reference-server/app-initdb.md#APP-INITDB-DATA-CHECKSUMS) 初始化叢集時停用。 之後也可以透過離線操作，在事後啟用或停用校驗和。資料校驗和是在 整個叢集層級啟用或停用，無法針對個別資料庫或資料表分別指定。

叢集中校驗和目前的狀態，可以透過檢視唯讀組態變數 [data\_checksums](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-preset.md#GUC-DATA-CHECKSUMS) 的值來確認， 方法是執行 `SHOW data_checksums` 指令。

在嘗試從頁面損毀中復原時，可能有必要略過校驗和保護。若要這麼做， 可以暫時設定組態參數 [ignore\_checksum\_failure](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-developer.md#GUC-IGNORE-CHECKSUM-FAILURE)。

#### 28.2.1. 離線啟用校驗和 [#](#checksums-offline-enable-disable) <a href="#checksums-offline-enable-disable" id="checksums-offline-enable-disable"></a>

[pg\_checksums](https://docs.postgresql.tw/19/reference/reference-server/app-pgchecksums.md) 應用程式可用來針對離線叢集啟用或停用資料校驗和，也可以用來驗證校驗和。

***

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


---

# 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/server-administration/wal/checksums.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.
