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

# 35.6. attributes \#

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

檢視表 `attributes` 包含資料庫中所定義之複合資料型別的屬性資訊。（請注意，此 檢視表不提供資料表欄位的資訊；在 PostgreSQL 的脈絡中，資料表欄位有時也稱為屬性。） 只會顯示目前使用者有權存取（身為該型別的擁有者或具有該型別的某種權限）的屬性。

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

| <p>欄位類型</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>attribute\_name</code> <code>sql\_identifier</code></p><p>屬性名稱</p>                                                                                                                                                                                          |
| <p><code>ordinal\_position</code> <code>cardinal\_number</code></p><p>屬性在該資料型別中的序數位置（從 1 開始計數）</p>                                                                                                                                                                   |
| <p><code>attribute\_default</code> <code>character\_data</code></p><p>屬性的預設表示式</p>                                                                                                                                                                                   |
| <p><code>is\_nullable</code> <code>yes\_or\_no</code></p><p>若屬性可能可以為 null，則為 <code>YES</code>； 若已知不可為 null，則為 <code>NO</code>。</p>                                                                                                                                   |
| <p><code>data\_type</code> <code>character\_data</code></p><p>若屬性的資料型別為內建型別，則為該資料型別；若為某種陣列，則為 <code>ARRAY</code>（此時請參閱檢視表 <code>element\_types</code>）；否則為 <code>USER-DEFINED</code>（此時型別由 <code>attribute\_udt\_name</code> 及相關欄位識別）。</p>                           |
| <p><code>character\_maximum\_length</code> <code>cardinal\_number</code></p><p>若 <code>data\_type</code> 識別的是字元或位元字串型別，則為 宣告的最大長度；若為其他所有資料型別，或未宣告最大長度，則為 null。</p>                                                                                                   |
| <p><code>character\_octet\_length</code> <code>cardinal\_number</code></p><p>若 <code>data\_type</code> 識別的是字元型別，則為單一資料值（datum） 可能的最大長度，以八位元組（位元組）計；若為其他所有資料型別，則為 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>若 <code>data\_type</code> 識別的是數值型別，此欄位包含此屬性之 型別的（宣告或隱含的）精確度。精確度表示有效位數，可以用十進位（以 10 為基數） 或二進位（以 2 為基數）表示，依欄位 <code>numeric\_precision\_radix</code> 所指定。若為其他所有資料 型別，此欄位為 null。</p>              |
| <p><code>numeric\_precision\_radix</code> <code>cardinal\_number</code></p><p>若 <code>data\_type</code> 識別的是數值型別，此欄位表示欄位 <code>numeric\_precision</code> 與 <code>numeric\_scale</code> 中的值是以哪一種基數表示。其值為 2 或 10。若為其他所有資料型別，此欄位為 null。</p>                             |
| <p><code>numeric\_scale</code> <code>cardinal\_number</code></p><p>若 <code>data\_type</code> 識別的是精確數值型別，此欄位包含 此屬性之型別的（宣告或隱含的）小數位數（scale）。小數位數表示小數點右側的有效位數， 可以用十進位（以 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> 識別的是時間間隔型別， 此欄位包含一項規格，說明此屬性的時間間隔包含哪些時間欄位（field），例如 <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>attribute\_udt\_catalog</code> <code>sql\_identifier</code></p><p>定義該屬性資料型別的資料庫名稱 （一律為目前資料庫）</p>                                                                                                                                                            |
| <p><code>attribute\_udt\_schema</code> <code>sql\_identifier</code></p><p>定義該屬性資料型別的綱要名稱</p>                                                                                                                                                                         |
| <p><code>attribute\_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>                                                                                                  |
| <p><code>is\_derived\_reference\_attribute</code> <code>yes\_or\_no</code></p><p>適用於 PostgreSQL 中未提供的功能</p>                                                                                                                                                          |

<br>

關於部分欄位的進一步資訊，另請參閱結構類似的檢視表[第 35.17 節](https://docs.postgresql.tw/19/client-interfaces/information-schema/infoschema-columns.md)。

***

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