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

# CHECKPOINT

### CHECKPOINT

CHECKPOINT — 強制執行預寫式日誌檢查點

### 語法

```

CHECKPOINT
```

### 說明

檢查點是預寫式日誌序列中的一個時間點，在該點上，所有資料檔都已更新以反映日誌中的資訊。所有資料檔都會被寫入（flush）到磁碟。關於檢查點期間會發生哪些事的更多細節，請參閱[第 28.5 節](https://docs.postgresql.tw/19/server-administration/wal/wal-configuration.md)。

`CHECKPOINT` 命令會在下達命令時強制立即執行檢查點，而不等待系統排定的定期檢查點（由[第 19.5.2 節](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-wal.md#runtime-config-wal-checkpoints)中的設定控制）。`CHECKPOINT` 並非設計給正常運作期間使用。

若在復原期間執行，`CHECKPOINT` 命令會強制執行重新啟動點（請參閱[第 28.5 節](https://docs.postgresql.tw/19/server-administration/wal/wal-configuration.md)），而不是寫入新的檢查點。

只有超級使用者或擁有 [pg\_checkpoint](https://docs.postgresql.tw/19/server-administration/user-manag/predefined-roles.md#PREDEFINED-ROLE-PG-CHECKPOINT) 角色權限的使用者，才能呼叫 `CHECKPOINT`。

### 相容性

`CHECKPOINT` 命令是 PostgreSQL 的語言擴充。

***

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


---

# 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/reference/sql-commands/sql-checkpoint.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.
