# 25. 備份及還原

與所有有價值的資料一樣，PostgreSQL 資料庫應該定期備份。雖然程序本質上很簡單，但對基本技術和假設有清晰的了解是很重要的。

以三種根本上不同的方法來備份 PostgreSQL 資料：

* SQL dump
* 檔案系統層級的備份
* 持續性歸檔封存

每個方式都有它的優點和缺點；以下各節將逐一討論。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.postgresql.tw/server-administration/backup-and-restore.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
