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

# 35.24. element\_types \#

### 35.24. `element_types` [#](#infoschema-element-types) <a href="#infoschema-element-types" id="infoschema-element-types"></a>

檢視表 `element_types` 包含陣列元素的資料型別描述子。當資料表欄位、複合型別屬性、網域、函式參數或函式回傳值被定義為陣列型別時，相應的資訊綱要檢視表只會在欄位 `data_type` 中包含 `ARRAY`。若要取得陣列元素型別的資訊，你可以將相應的檢視表與此檢視表連接。例如，若要顯示某資料表的欄位及其資料型別，以及（若適用）陣列元素型別，你可以這樣做：

```

SELECT c.column_name, c.data_type, e.data_type AS element_type
FROM information_schema.columns c LEFT JOIN information_schema.element_types e
     ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
       = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier))
WHERE c.table_schema = '...' AND c.table_name = '...'
ORDER BY c.ordinal_position;
```

此檢視表只包含目前使用者有權存取（身為擁有者或具有某種權限）的物件。

#### 表 35.22. `element_types` 欄位 [#](#infoschema-element-types-columns) <a href="#infoschema-element-types-columns" id="infoschema-element-types-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                                                                     |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>object\_catalog</code> <code>sql\_identifier</code></p><p>包含使用所描述陣列之物件的資料庫名稱（一律為目前資料庫）</p>                                                                                                                                                      |
| <p><code>object\_schema</code> <code>sql\_identifier</code></p><p>包含使用所描述陣列之物件的綱要名稱</p>                                                                                                                                                                  |
| <p><code>object\_name</code> <code>sql\_identifier</code></p><p>使用所描述陣列之物件的名稱</p>                                                                                                                                                                        |
| <p><code>object\_type</code> <code>character\_data</code></p><p>使用所描述陣列之物件的類型，為下列之一：<code>TABLE</code>（該陣列由該資料表的某個欄位使用）、<code>USER-DEFINED TYPE</code>（該陣列由該複合型別的某個屬性使用）、<code>DOMAIN</code>（該陣列由該網域使用）、<code>ROUTINE</code>（該陣列由該函式的某個參數或回傳資料型別使用）。</p> |
| <p><code>collection\_type\_identifier</code> <code>sql\_identifier</code></p><p>所描述陣列之資料型別描述子的識別碼。可用它與其他資訊綱要檢視表的 <code>dtd\_identifier</code> 欄位進行連接。</p>                                                                                                |
| <p><code>data\_type</code> <code>character\_data</code></p><p>若陣列元素為內建型別，則為陣列元素的資料型別；否則為 <code>USER-DEFINED</code>（此時型別由 <code>udt\_name</code> 及相關欄位識別）。</p>                                                                                            |
| <p><code>character\_maximum\_length</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於陣列元素資料型別</p>                                                                                                                              |
| <p><code>character\_octet\_length</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於陣列元素資料型別</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>一律為 null，因為 PostgreSQL 不會將此資訊套用於陣列元素資料型別</p>                                                                                                                                      |
| <p><code>numeric\_precision\_radix</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於陣列元素資料型別</p>                                                                                                                               |
| <p><code>numeric\_scale</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於陣列元素資料型別</p>                                                                                                                                          |
| <p><code>datetime\_precision</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於陣列元素資料型別</p>                                                                                                                                     |
| <p><code>interval\_type</code> <code>character\_data</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於陣列元素資料型別</p>                                                                                                                                           |
| <p><code>interval\_precision</code> <code>cardinal\_number</code></p><p>一律為 null，因為 PostgreSQL 不會將此資訊套用於陣列元素資料型別</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-element-types.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-element-types.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.
