# 1.1. 安裝

你需要先進行安裝，才能開始使用PostgreSQL。當然，PostgreSQL也可能已經被安裝在你的系統之中，因為你的作業系統預設套件包含了PostgreSQL，或其他系統管理者已先行安裝。如果是這樣的話，那麼你應該先瞭解作業系統的資訊，或向你的系統管理員取能存取的資訊。

如果你並不確定PostgreSQL是否已經可以使用，或者你也可以自行安裝試試。這樣做並不是很困難，而且是很好的操作練習。PostgreSQL可以以一般使用者進行安裝，它並不需要系統管理者（root）的權限才能安裝。

如果你打算自行安裝PostgreSQL，你可以參考第16章的指令進行，完成之後再回到這裡，以瞭解接下來關於設定環境變數的內容。

如果你的系統管理者並非以預設的方式安裝，你可能還有一些額外的工作要做。例如，如果資料庫主機其實是遠端的伺服器，你會需要設定PGHOST的環境變數，將其指向資料庫主機的網路名稱。而PGPORT變數也是必須要設定的。最基本的情境是，如果你嘗試啓動一個應用程式，而它回報它無法取得資料庫連線時，你就必須洽詢你的系統管理者。而如果系統管理者就是你自己，那麼你應該依文件再確認你的環境設定是正確的。如果你仍然並不清楚前面所描述的事項，請詳細閱讀[下一節](https://github.com/pgsql-tw/documents/tree/a096b206440e1ac8cdee57e1ae7a74730f0ee146/getting-started/12-architectural-fundamentals.md)的內容。


---

# 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/11/tutorial/getting-started/installation.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.
