]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/infoschema-element-types.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / infoschema-element-types.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>35.24. element_types</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="infoschema-domains.html" title="35.23. domains" /><link rel="next" href="infoschema-enabled-roles.html" title="35.25. enabled_roles" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">35.24. <code class="literal">element_types</code></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="infoschema-domains.html" title="35.23. domains">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="information-schema.html" title="Chapter 35. The Information Schema">Up</a></td><th width="60%" align="center">Chapter 35. The Information Schema</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="infoschema-enabled-roles.html" title="35.25. enabled_roles">Next</a></td></tr></table><hr /></div><div class="sect1" id="INFOSCHEMA-ELEMENT-TYPES"><div class="titlepage"><div><div><h2 class="title" style="clear: both">35.24. <code class="literal">element_types</code> <a href="#INFOSCHEMA-ELEMENT-TYPES" class="id_link">#</a></h2></div></div></div><p>
3    The view <code class="literal">element_types</code> contains the data type
4    descriptors of the elements of arrays.  When a table column, composite-type attribute,
5    domain, function parameter, or function return value is defined to
6    be of an array type, the respective information schema view only
7    contains <code class="literal">ARRAY</code> in the column
8    <code class="literal">data_type</code>.  To obtain information on the element
9    type of the array, you can join the respective view with this view.
10    For example, to show the columns of a table with data types and
11    array element types, if applicable, you could do:
12 </p><pre class="programlisting">
13 SELECT c.column_name, c.data_type, e.data_type AS element_type
14 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
15      ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
16        = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier))
17 WHERE c.table_schema = '...' AND c.table_name = '...'
18 ORDER BY c.ordinal_position;
19 </pre><p>
20    This view only includes objects that the current user has access
21    to, by way of being the owner or having some privilege.
22   </p><div class="table" id="id-1.7.6.28.3"><p class="title"><strong>Table 35.22. <code class="structname">element_types</code> Columns</strong></p><div class="table-contents"><table class="table" summary="element_types Columns" border="1"><colgroup><col /></colgroup><thead><tr><th class="catalog_table_entry"><p class="column_definition">
23        Column Type
24       </p>
25       <p>
26        Description
27       </p></th></tr></thead><tbody><tr><td class="catalog_table_entry"><p class="column_definition">
28        <code class="structfield">object_catalog</code> <code class="type">sql_identifier</code>
29       </p>
30       <p>
31        Name of the database that contains the object that uses the
32        array being described (always the current database)
33       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
34        <code class="structfield">object_schema</code> <code class="type">sql_identifier</code>
35       </p>
36       <p>
37        Name of the schema that contains the object that uses the array
38        being described
39       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
40        <code class="structfield">object_name</code> <code class="type">sql_identifier</code>
41       </p>
42       <p>
43        Name of the object that uses the array being described
44       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
45        <code class="structfield">object_type</code> <code class="type">character_data</code>
46       </p>
47       <p>
48        The type of the object that uses the array being described: one
49        of <code class="literal">TABLE</code> (the array is used by a column of
50        that table), <code class="literal">USER-DEFINED TYPE</code> (the array is
51        used by an attribute of that composite type),
52        <code class="literal">DOMAIN</code> (the array is used by that domain),
53        <code class="literal">ROUTINE</code> (the array is used by a parameter or
54        the return data type of that function).
55       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
56        <code class="structfield">collection_type_identifier</code> <code class="type">sql_identifier</code>
57       </p>
58       <p>
59        The identifier of the data type descriptor of the array being
60        described.  Use this to join with the
61        <code class="literal">dtd_identifier</code> columns of other information
62        schema views.
63       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
64        <code class="structfield">data_type</code> <code class="type">character_data</code>
65       </p>
66       <p>
67        Data type of the array elements, if it is a built-in type, else
68        <code class="literal">USER-DEFINED</code> (in that case, the type is
69        identified in <code class="literal">udt_name</code> and associated
70        columns).
71       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
72        <code class="structfield">character_maximum_length</code> <code class="type">cardinal_number</code>
73       </p>
74       <p>
75        Always null, since this information is not applied to array element data types in <span class="productname">PostgreSQL</span>
76       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
77        <code class="structfield">character_octet_length</code> <code class="type">cardinal_number</code>
78       </p>
79       <p>
80        Always null, since this information is not applied to array element data types in <span class="productname">PostgreSQL</span>
81       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
82        <code class="structfield">character_set_catalog</code> <code class="type">sql_identifier</code>
83       </p>
84       <p>
85        Applies to a feature not available in <span class="productname">PostgreSQL</span>
86       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
87        <code class="structfield">character_set_schema</code> <code class="type">sql_identifier</code>
88       </p>
89       <p>
90        Applies to a feature not available in <span class="productname">PostgreSQL</span>
91       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
92        <code class="structfield">character_set_name</code> <code class="type">sql_identifier</code>
93       </p>
94       <p>
95        Applies to a feature not available in <span class="productname">PostgreSQL</span>
96       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
97        <code class="structfield">collation_catalog</code> <code class="type">sql_identifier</code>
98       </p>
99       <p>
100        Name of the database containing the collation of the element
101        type (always the current database), null if default or the data
102        type of the element is not collatable
103       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
104        <code class="structfield">collation_schema</code> <code class="type">sql_identifier</code>
105       </p>
106       <p>
107        Name of the schema containing the collation of the element
108        type, null if default or the data type of the element is not
109        collatable
110       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
111        <code class="structfield">collation_name</code> <code class="type">sql_identifier</code>
112       </p>
113       <p>
114        Name of the collation of the element type, null if default or
115        the data type of the element is not collatable
116       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
117        <code class="structfield">numeric_precision</code> <code class="type">cardinal_number</code>
118       </p>
119       <p>
120        Always null, since this information is not applied to array element data types in <span class="productname">PostgreSQL</span>
121       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
122        <code class="structfield">numeric_precision_radix</code> <code class="type">cardinal_number</code>
123       </p>
124       <p>
125        Always null, since this information is not applied to array element data types in <span class="productname">PostgreSQL</span>
126       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
127        <code class="structfield">numeric_scale</code> <code class="type">cardinal_number</code>
128       </p>
129       <p>
130        Always null, since this information is not applied to array element data types in <span class="productname">PostgreSQL</span>
131       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
132        <code class="structfield">datetime_precision</code> <code class="type">cardinal_number</code>
133       </p>
134       <p>
135        Always null, since this information is not applied to array element data types in <span class="productname">PostgreSQL</span>
136       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
137        <code class="structfield">interval_type</code> <code class="type">character_data</code>
138       </p>
139       <p>
140        Always null, since this information is not applied to array element data types in <span class="productname">PostgreSQL</span>
141       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
142        <code class="structfield">interval_precision</code> <code class="type">cardinal_number</code>
143       </p>
144       <p>
145        Always null, since this information is not applied to array element data types in <span class="productname">PostgreSQL</span>
146       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
147        <code class="structfield">udt_catalog</code> <code class="type">sql_identifier</code>
148       </p>
149       <p>
150        Name of the database that the data type of the elements is
151        defined in (always the current database)
152       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
153        <code class="structfield">udt_schema</code> <code class="type">sql_identifier</code>
154       </p>
155       <p>
156        Name of the schema that the data type of the elements is
157        defined in
158       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
159        <code class="structfield">udt_name</code> <code class="type">sql_identifier</code>
160       </p>
161       <p>
162        Name of the data type of the elements
163       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
164        <code class="structfield">scope_catalog</code> <code class="type">sql_identifier</code>
165       </p>
166       <p>
167        Applies to a feature not available in <span class="productname">PostgreSQL</span>
168       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
169        <code class="structfield">scope_schema</code> <code class="type">sql_identifier</code>
170       </p>
171       <p>
172        Applies to a feature not available in <span class="productname">PostgreSQL</span>
173       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
174        <code class="structfield">scope_name</code> <code class="type">sql_identifier</code>
175       </p>
176       <p>
177        Applies to a feature not available in <span class="productname">PostgreSQL</span>
178       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
179        <code class="structfield">maximum_cardinality</code> <code class="type">cardinal_number</code>
180       </p>
181       <p>
182        Always null, because arrays always have unlimited maximum cardinality in <span class="productname">PostgreSQL</span>
183       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
184        <code class="structfield">dtd_identifier</code> <code class="type">sql_identifier</code>
185       </p>
186       <p>
187        An identifier of the data type descriptor of the element.  This
188        is currently not useful.
189       </p></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="infoschema-domains.html" title="35.23. domains">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="information-schema.html" title="Chapter 35. The Information Schema">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="infoschema-enabled-roles.html" title="35.25. enabled_roles">Next</a></td></tr><tr><td width="40%" align="left" valign="top">35.23. <code class="literal">domains</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 35.25. <code class="literal">enabled_roles</code></td></tr></table></div></body></html>