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

# 35.23. domains \#

### 35.23. `domains` [#](#infoschema-domains) <a href="#infoschema-domains" id="infoschema-domains"></a>

檢視表 `domains` 包含目前資料庫中定義的所有[*網域*](https://docs.postgresql.tw/19/appendixes/glossary.md#glossary-domain)。只會顯示目前使用者有權存取（身為擁有者或具有某種權限）的網域。

#### 表 35.21. `domains` 欄位 [#](#infoschema-domains-columns) <a href="#infoschema-domains-columns" id="infoschema-domains-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                                                           |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>domain\_catalog</code> <code>sql\_identifier</code></p><p>包含該網域的資料庫名稱（一律為目前資料庫）</p>                                                                                                                                                   |
| <p><code>domain\_schema</code> <code>sql\_identifier</code></p><p>包含該網域的綱要名稱</p>                                                                                                                                                               |
| <p><code>domain\_name</code> <code>sql\_identifier</code></p><p>網域名稱</p>                                                                                                                                                                       |
| <p><code>data\_type</code> <code>character\_data</code></p><p>若網域為內建型別，則為該網域的資料型別；若為某種陣列，則為 <code>ARRAY</code>（此時請參閱檢視表 <code>element\_types</code>）；否則為 <code>USER-DEFINED</code>（此時型別由 <code>udt\_name</code> 及相關欄位識別）。</p>                  |
| <p><code>character\_maximum\_length</code> <code>cardinal\_number</code></p><p>若網域為字元或位元字串型別，則為宣告的最大長度；其他資料型別，或未宣告最大長度時，則為 null。</p>                                                                                                           |
| <p><code>character\_octet\_length</code> <code>cardinal\_number</code></p><p>若網域為字元型別，則為單一資料值以八位元組（位元組）計的最大可能長度；其他資料型別則為 null。最大八位元組長度取決於宣告的字元最大長度（見上方）與伺服器編碼。</p>                                                                             |
| <p><code>character\_set\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                          |
| <p><code>character\_set\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                           |
| <p><code>character\_set\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                             |
| <p><code>collation\_catalog</code> <code>sql\_identifier</code></p><p>包含該網域之定序的資料庫名稱（一律為目前資料庫）；若為預設定序，或網域的資料型別不可定序，則為 null</p>                                                                                                                 |
| <p><code>collation\_schema</code> <code>sql\_identifier</code></p><p>包含該網域之定序的綱要名稱；若為預設定序，或網域的資料型別不可定序，則為 null</p>                                                                                                                             |
| <p><code>collation\_name</code> <code>sql\_identifier</code></p><p>該網域之定序的名稱；若為預設定序，或網域的資料型別不可定序，則為 null</p>                                                                                                                                   |
| <p><code>numeric\_precision</code> <code>cardinal\_number</code></p><p>若網域為數值型別，此欄位包含此網域之型別的（宣告或隱含）精確度。精確度表示有效位數。它可以用十進位（基數 10）或二進位（基數 2）表示，如欄位 <code>numeric\_precision\_radix</code> 所指定。其他資料型別，此欄位為 null。</p>                               |
| <p><code>numeric\_precision\_radix</code> <code>cardinal\_number</code></p><p>若網域為數值型別，此欄位表示欄位 <code>numeric\_precision</code> 與 <code>numeric\_scale</code> 中的值以何種基數表示。其值為 2 或 10。其他資料型別，此欄位為 null。</p>                                       |
| <p><code>numeric\_scale</code> <code>cardinal\_number</code></p><p>若網域為精確數值型別，此欄位包含此網域之型別的（宣告或隱含）小數位數。小數位數表示小數點右側的有效位數。它可以用十進位（基數 10）或二進位（基數 2）表示，如欄位 <code>numeric\_precision\_radix</code> 所指定。其他資料型別，此欄位為 null。</p>                         |
| <p><code>datetime\_precision</code> <code>cardinal\_number</code></p><p>若 <code>data\_type</code> 表示日期、時間、時間戳記或時間間隔型別，此欄位包含此網域之型別的（宣告或隱含）小數秒精確度，也就是秒值中小數點之後保留的十進位位數。其他資料型別，此欄位為 null。</p>                                                      |
| <p><code>interval\_type</code> <code>character\_data</code></p><p>若 <code>data\_type</code> 表示時間間隔型別，此欄位包含此網域的時間間隔包含哪些時間欄位的規格，例如 <code>YEAR TO MONTH</code>、<code>DAY TO SECOND</code> 等。若未指定時間欄位限制（亦即該時間間隔接受所有時間欄位），以及其他所有資料型別，此欄位為 null。</p> |
| <p><code>interval\_precision</code> <code>cardinal\_number</code></p><p>適用於 PostgreSQL 中未提供的功能（時間間隔型別網域的小數秒精確度請參閱 <code>datetime\_precision</code>）</p>                                                                                        |
| <p><code>domain\_default</code> <code>character\_data</code></p><p>網域的預設值運算式</p>                                                                                                                                                               |
| <p><code>udt\_catalog</code> <code>sql\_identifier</code></p><p>定義該網域之資料型別的資料庫名稱（一律為目前資料庫）</p>                                                                                                                                                 |
| <p><code>udt\_schema</code> <code>sql\_identifier</code></p><p>定義該網域之資料型別的綱要名稱</p>                                                                                                                                                             |
| <p><code>udt\_name</code> <code>sql\_identifier</code></p><p>該網域之資料型別的名稱</p>                                                                                                                                                                   |
| <p><code>scope\_catalog</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                   |
| <p><code>scope\_schema</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                    |
| <p><code>scope\_name</code> <code>sql\_identifier</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                      |
| <p><code>maximum\_cardinality</code> <code>cardinal\_number</code></p><p>一律為 null，因為在 PostgreSQL 中陣列的最大基數一律為無限制</p>                                                                                                                            |
| <p><code>dtd\_identifier</code> <code>sql\_identifier</code></p><p>網域之資料型別描述子的識別碼，在與該網域相關的資料型別描述子中是唯一的（這是理所當然的，因為一個網域只包含一個資料型別描述子）。這主要用於與此類識別碼的其他實例進行連接。（識別碼的具體格式並未定義，也不保證在未來版本中維持不變。）</p>                                                     |

<br>

***

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