> 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/client-interfaces/information-schema/infoschema-element-types.md).

# 35.24. element\_types \#

The view `element_types` contains the data type descriptors of the elements of arrays. When a table column, composite-type attribute, domain, function parameter, or function return value is defined to be of an array type, the respective information schema view only contains `ARRAY` in the column `data_type`. To obtain information on the element type of the array, you can join the respective view with this view. For example, to show the columns of a table with data types and array element types, if applicable, you could do:

```

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;
```

This view only includes objects that the current user has access to, by way of being the owner or having some privilege.

**Table 35.22. `element_types` Columns**

| <p>Column Type</p><p>Description</p>                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>object\_catalog</code> <code>sql\_identifier</code></p><p>Name of the database that contains the object that uses the array being described (always the current database)</p>                                                                                                                                                                                                                                                                        |
| <p><code>object\_schema</code> <code>sql\_identifier</code></p><p>Name of the schema that contains the object that uses the array being described</p>                                                                                                                                                                                                                                                                                                         |
| <p><code>object\_name</code> <code>sql\_identifier</code></p><p>Name of the object that uses the array being described</p>                                                                                                                                                                                                                                                                                                                                    |
| <p><code>object\_type</code> <code>character\_data</code></p><p>The type of the object that uses the array being described: one of <code>TABLE</code> (the array is used by a column of that table), <code>USER-DEFINED TYPE</code> (the array is used by an attribute of that composite type), <code>DOMAIN</code> (the array is used by that domain), <code>ROUTINE</code> (the array is used by a parameter or the return data type of that function).</p> |
| <p><code>collection\_type\_identifier</code> <code>sql\_identifier</code></p><p>The identifier of the data type descriptor of the array being described. Use this to join with the <code>dtd\_identifier</code> columns of other information schema views.</p>                                                                                                                                                                                                |
| <p><code>data\_type</code> <code>character\_data</code></p><p>Data type of the array elements, if it is a built-in type, else <code>USER-DEFINED</code> (in that case, the type is identified in <code>udt\_name</code> and associated columns).</p>                                                                                                                                                                                                          |
| <p><code>character\_maximum\_length</code> <code>cardinal\_number</code></p><p>Always null, since this information is not applied to array element data types in PostgreSQL</p>                                                                                                                                                                                                                                                                               |
| <p><code>character\_octet\_length</code> <code>cardinal\_number</code></p><p>Always null, since this information is not applied to array element data types in PostgreSQL</p>                                                                                                                                                                                                                                                                                 |
| <p><code>character\_set\_catalog</code> <code>sql\_identifier</code></p><p>Applies to a feature not available in PostgreSQL</p>                                                                                                                                                                                                                                                                                                                               |
| <p><code>character\_set\_schema</code> <code>sql\_identifier</code></p><p>Applies to a feature not available in PostgreSQL</p>                                                                                                                                                                                                                                                                                                                                |
| <p><code>character\_set\_name</code> <code>sql\_identifier</code></p><p>Applies to a feature not available in PostgreSQL</p>                                                                                                                                                                                                                                                                                                                                  |
| <p><code>collation\_catalog</code> <code>sql\_identifier</code></p><p>Name of the database containing the collation of the element type (always the current database), null if default or the data type of the element is not collatable</p>                                                                                                                                                                                                                  |
| <p><code>collation\_schema</code> <code>sql\_identifier</code></p><p>Name of the schema containing the collation of the element type, null if default or the data type of the element is not collatable</p>                                                                                                                                                                                                                                                   |
| <p><code>collation\_name</code> <code>sql\_identifier</code></p><p>Name of the collation of the element type, null if default or the data type of the element is not collatable</p>                                                                                                                                                                                                                                                                           |
| <p><code>numeric\_precision</code> <code>cardinal\_number</code></p><p>Always null, since this information is not applied to array element data types in PostgreSQL</p>                                                                                                                                                                                                                                                                                       |
| <p><code>numeric\_precision\_radix</code> <code>cardinal\_number</code></p><p>Always null, since this information is not applied to array element data types in PostgreSQL</p>                                                                                                                                                                                                                                                                                |
| <p><code>numeric\_scale</code> <code>cardinal\_number</code></p><p>Always null, since this information is not applied to array element data types in PostgreSQL</p>                                                                                                                                                                                                                                                                                           |
| <p><code>datetime\_precision</code> <code>cardinal\_number</code></p><p>Always null, since this information is not applied to array element data types in PostgreSQL</p>                                                                                                                                                                                                                                                                                      |
| <p><code>interval\_type</code> <code>character\_data</code></p><p>Always null, since this information is not applied to array element data types in PostgreSQL</p>                                                                                                                                                                                                                                                                                            |
| <p><code>interval\_precision</code> <code>cardinal\_number</code></p><p>Always null, since this information is not applied to array element data types in PostgreSQL</p>                                                                                                                                                                                                                                                                                      |
| <p><code>udt\_catalog</code> <code>sql\_identifier</code></p><p>Name of the database that the data type of the elements is defined in (always the current database)</p>                                                                                                                                                                                                                                                                                       |
| <p><code>udt\_schema</code> <code>sql\_identifier</code></p><p>Name of the schema that the data type of the elements is defined in</p>                                                                                                                                                                                                                                                                                                                        |
| <p><code>udt\_name</code> <code>sql\_identifier</code></p><p>Name of the data type of the elements</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p><code>scope\_catalog</code> <code>sql\_identifier</code></p><p>Applies to a feature not available in PostgreSQL</p>                                                                                                                                                                                                                                                                                                                                        |
| <p><code>scope\_schema</code> <code>sql\_identifier</code></p><p>Applies to a feature not available in PostgreSQL</p>                                                                                                                                                                                                                                                                                                                                         |
| <p><code>scope\_name</code> <code>sql\_identifier</code></p><p>Applies to a feature not available in PostgreSQL</p>                                                                                                                                                                                                                                                                                                                                           |
| <p><code>maximum\_cardinality</code> <code>cardinal\_number</code></p><p>Always null, because arrays always have unlimited maximum cardinality in PostgreSQL</p>                                                                                                                                                                                                                                                                                              |
| <p><code>dtd\_identifier</code> <code>sql\_identifier</code></p><p>An identifier of the data type descriptor of the element. This is currently not useful.</p>                                                                                                                                                                                                                                                                                                |

<br>

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/infoschema-element-types.html)（英文原文，待翻譯）


---

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