> 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/appendixes/color/color-which.md).

# N.2. 設定色彩 \#

實際要使用的色彩由環境變數 `PG_COLORS`（注意是複數）設定。其值為以冒號分隔的 `key=value` 配對清單。鍵指定色彩的用途；值則是由終端機解譯的 SGR（Select Graphic Rendition）規格。

目前使用下列鍵：

`error` : 用於醒目顯示錯誤訊息中的「error」文字

`warning` : 用於醒目顯示警告訊息中的「warning」文字

`note` : 用於醒目顯示此類訊息中的「detail」與「hint」文字

`locus` : 用於醒目顯示訊息中的位置資訊（例如程式名稱與檔案名稱）

預設值為 `error=01;31:warning=01;35:note=01;36:locus=01`（`01;31` 代表粗體紅色，`01;35` 代表粗體洋紅色，`01;36` 代表粗體青色，`01` 代表粗體的預設色彩）。

## 提示

GCC、GNU coreutils 與 GNU grep 等其他軟體套件也使用此色彩規格格式。

***

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


---

# 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 dynamically by asking a question.

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

```
GET https://docs.postgresql.tw/appendixes/color/color-which.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
