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

# 35.7. character\_sets \#

### 35.7. `character_sets` [#](#infoschema-character-sets) <a href="#infoschema-character-sets" id="infoschema-character-sets"></a>

檢視表 `character_sets` 識別目前資料庫中可用的字元集。由於 PostgreSQL 不支援 在單一資料庫中使用多個字元集，此檢視表只會顯示一個，也就是資料庫編碼。

請留意下列術語在 SQL 標準中的用法：

字元庫（character repertoire） : 字元的抽象集合，例如 `UNICODE`、`UCS` 或 `LATIN1`。它不會以 SQL 物件的形式公開，但可以在此檢視表中看到。

字元編碼形式（character encoding form） : 某個字元庫的一種編碼。大多數較舊的字元庫只使用一種編碼形式，因此這些編碼形式 沒有另外的名稱（例如，`LATIN2` 是適用於 `LATIN2` 字元庫的編碼形式）。但舉例來說，Unicode 有 `UTF8`、`UTF16` 等編碼形式 （並非全部都受 PostgreSQL 支援）。編碼形式不會以 SQL 物件的形式公開，但可以在此 檢視表中看到。

字元集（character set） : 一個具名的 SQL 物件，用來識別一個字元庫、一種字元編碼與一個預設定序。預先定義的 字元集通常會與某個編碼形式同名，但使用者可以定義其他名稱。例如，字元集 `UTF8` 通常會識別字元庫 `UCS`、編碼形式 `UTF8`，以及某個預設定序。

你可以把 PostgreSQL 中的「編碼」視為字元集，也可以視為字元編碼形式。兩者的名稱 相同，而且一個資料庫中只能有一個。

#### 表 35.5. `character_sets` 欄位 [#](#infoschema-character-sets-columns) <a href="#infoschema-character-sets-columns" id="infoschema-character-sets-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>character\_set\_catalog</code> <code>sql\_identifier</code></p><p>字元集目前並未實作為綱要物件，因此此欄位為 null。</p>                                                                              |
| <p><code>character\_set\_schema</code> <code>sql\_identifier</code></p><p>字元集目前並未實作為綱要物件，因此此欄位為 null。</p>                                                                               |
| <p><code>character\_set\_name</code> <code>sql\_identifier</code></p><p>字元集名稱，目前的實作是顯示資料庫編碼的名稱</p>                                                                                      |
| <p><code>character\_repertoire</code> <code>sql\_identifier</code></p><p>字元庫；顯示 <code>UCS</code>（若編碼為 <code>UTF8</code>），否則只顯示編碼名稱</p>                                                  |
| <p><code>form\_of\_use</code> <code>sql\_identifier</code></p><p>字元編碼形式，與資料庫編碼相同</p>                                                                                                    |
| <p><code>default\_collate\_catalog</code> <code>sql\_identifier</code></p><p>包含預設定序的資料庫名稱（若有識別出任何定序，則一律為目前資料庫）</p>                                                                      |
| <p><code>default\_collate\_schema</code> <code>sql\_identifier</code></p><p>包含預設定序的綱要名稱</p>                                                                                             |
| <p><code>default\_collate\_name</code> <code>sql\_identifier</code></p><p>預設定序的名稱。預設定序是指與目前資料庫的 <code>COLLATE</code> 與 <code>CTYPE</code> 設定相符的定序。若沒有這樣的定序，則此欄位以及相關的綱要與目錄欄位皆為 null。</p> |

<br>

***

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


---

# 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/client-interfaces/information-schema/infoschema-character-sets.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.
