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

# 第 25 章：備份與還原

### 第 25 章：備份與還原

**目錄**

* [25.1. SQL 傾印](https://docs.postgresql.tw/19/server-administration/backup/backup-dump.md)
  * [25.1.1. 還原傾印內容](https://docs.postgresql.tw/19/server-administration/backup/backup-dump.md#backup-dump-restore)
  * [25.1.2. 使用 pg\_dumpall](https://docs.postgresql.tw/19/server-administration/backup/backup-dump.md#backup-dump-all)
  * [25.1.3. 處理大型資料庫](https://docs.postgresql.tw/19/server-administration/backup/backup-dump.md#backup-dump-large)
* [25.2. 檔案系統層級備份](https://docs.postgresql.tw/19/server-administration/backup/backup-file.md)
* [25.3. 持續歸檔與時間點還原（PITR）](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md)
  * [25.3.1. 設定 WAL 歸檔](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md#backup-archiving-wal)
  * [25.3.2. 製作基礎備份](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md#backup-base-backup)
  * [25.3.3. 製作增量備份](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md#backup-incremental-backup)
  * [25.3.4. 使用低階 API 製作基礎備份](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md#backup-lowlevel-base-backup)
  * [25.3.5. 使用持續歸檔備份進行還原](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md#backup-pitr-recovery)
  * [25.3.6. 時間軸](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md#backup-timelines)
  * [25.3.7. 技巧與範例](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md#backup-tips)
  * [25.3.8. 注意事項](https://docs.postgresql.tw/19/server-administration/backup/continuous-archiving.md#continuous-archiving-caveats)

如同任何存放重要資料的系統一樣，PostgreSQL 資料庫應該定期備份。雖然備份程序基本上很簡單， 但重要的是要清楚理解其背後所依據的技術與前提假設。

備份 PostgreSQL 資料有三種根本不同的方式：

* SQL 傾印
* 檔案系統層級備份
* 持續歸檔

每種方式各有其優缺點；以下各節將依序討論每一種方式。

***

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


---

# 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/backup.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.
