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

# 1.2. 架構基礎 \#

### 1.2. 架構基礎 [#](#tutorial-arch) <a href="#tutorial-arch" id="tutorial-arch"></a>

在繼續之前，你應該先瞭解 PostgreSQL 的基本系統架構。瞭解 PostgreSQL 各個部分如何互動，會讓本章的內容更容易理解。

以資料庫術語來說，PostgreSQL 採用用戶端／伺服器（client/server）模型。一個 PostgreSQL 工作階段（session）由下列相互協作的程序（程式）組成：

* 伺服器程序：負責管理資料庫檔案、接受用戶端應用程式對資料庫的連線，並代表用戶端執行資料庫操作。資料庫伺服器程式名為 `postgres`。
* 使用者用來執行資料庫操作的用戶端（前端）應用程式。用戶端應用程式的性質可能差異很大：可以是文字介面工具、圖形介面應用程式、存取資料庫以顯示網頁的 Web 伺服器，或專用的資料庫維護工具。部分用戶端應用程式隨 PostgreSQL 發行版本提供，大多數則由使用者自行開發。

如同一般的用戶端／伺服器應用程式，用戶端與伺服器可以位於不同的主機上，此時兩者透過 TCP/IP 網路連線通訊。請記住這一點，因為在用戶端機器上可以存取的檔案，在資料庫伺服器機器上可能無法存取（或只能以不同的檔名存取）。

PostgreSQL 伺服器可以同時處理來自用戶端的多個連線。為此，它會為每個連線啟動（「fork」）一個新的程序。從那時起，用戶端與新的伺服器程序直接通訊，不需要原本的 `postgres` 程序介入。因此，監督用的伺服器程序會一直執行並等待用戶端連線，而用戶端與其對應的伺服器程序則會隨連線出現與結束。（當然，這一切對使用者而言都是不可見的，這裡只是為了完整說明而提及。）

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/tutorial-arch.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/tutorial/tutorial-start/tutorial-arch.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.
