]> begriffs open source - ai-pg/blob - full-docs/txt/infoschema-element-types.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / infoschema-element-types.txt
1
2 35.24. element_types #
3
4    The view element_types contains the data type descriptors of the
5    elements of arrays. When a table column, composite-type attribute,
6    domain, function parameter, or function return value is defined to be
7    of an array type, the respective information schema view only contains
8    ARRAY in the column data_type. To obtain information on the element
9    type of the array, you can join the respective view with this view. For
10    example, to show the columns of a table with data types and array
11    element types, if applicable, you could do:
12 SELECT c.column_name, c.data_type, e.data_type AS element_type
13 FROM information_schema.columns c LEFT JOIN information_schema.element_types e
14      ON ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifi
15 er)
16        = (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.col
17 lection_type_identifier))
18 WHERE c.table_schema = '...' AND c.table_name = '...'
19 ORDER BY c.ordinal_position;
20
21    This view only includes objects that the current user has access to, by
22    way of being the owner or having some privilege.
23
24    Table 35.22. element_types Columns
25
26    Column Type
27
28    Description
29
30    object_catalog sql_identifier
31
32    Name of the database that contains the object that uses the array being
33    described (always the current database)
34
35    object_schema sql_identifier
36
37    Name of the schema that contains the object that uses the array being
38    described
39
40    object_name sql_identifier
41
42    Name of the object that uses the array being described
43
44    object_type character_data
45
46    The type of the object that uses the array being described: one of
47    TABLE (the array is used by a column of that table), USER-DEFINED TYPE
48    (the array is used by an attribute of that composite type), DOMAIN (the
49    array is used by that domain), ROUTINE (the array is used by a
50    parameter or the return data type of that function).
51
52    collection_type_identifier sql_identifier
53
54    The identifier of the data type descriptor of the array being
55    described. Use this to join with the dtd_identifier columns of other
56    information schema views.
57
58    data_type character_data
59
60    Data type of the array elements, if it is a built-in type, else
61    USER-DEFINED (in that case, the type is identified in udt_name and
62    associated columns).
63
64    character_maximum_length cardinal_number
65
66    Always null, since this information is not applied to array element
67    data types in PostgreSQL
68
69    character_octet_length cardinal_number
70
71    Always null, since this information is not applied to array element
72    data types in PostgreSQL
73
74    character_set_catalog sql_identifier
75
76    Applies to a feature not available in PostgreSQL
77
78    character_set_schema sql_identifier
79
80    Applies to a feature not available in PostgreSQL
81
82    character_set_name sql_identifier
83
84    Applies to a feature not available in PostgreSQL
85
86    collation_catalog sql_identifier
87
88    Name of the database containing the collation of the element type
89    (always the current database), null if default or the data type of the
90    element is not collatable
91
92    collation_schema sql_identifier
93
94    Name of the schema containing the collation of the element type, null
95    if default or the data type of the element is not collatable
96
97    collation_name sql_identifier
98
99    Name of the collation of the element type, null if default or the data
100    type of the element is not collatable
101
102    numeric_precision cardinal_number
103
104    Always null, since this information is not applied to array element
105    data types in PostgreSQL
106
107    numeric_precision_radix cardinal_number
108
109    Always null, since this information is not applied to array element
110    data types in PostgreSQL
111
112    numeric_scale cardinal_number
113
114    Always null, since this information is not applied to array element
115    data types in PostgreSQL
116
117    datetime_precision cardinal_number
118
119    Always null, since this information is not applied to array element
120    data types in PostgreSQL
121
122    interval_type character_data
123
124    Always null, since this information is not applied to array element
125    data types in PostgreSQL
126
127    interval_precision cardinal_number
128
129    Always null, since this information is not applied to array element
130    data types in PostgreSQL
131
132    udt_catalog sql_identifier
133
134    Name of the database that the data type of the elements is defined in
135    (always the current database)
136
137    udt_schema sql_identifier
138
139    Name of the schema that the data type of the elements is defined in
140
141    udt_name sql_identifier
142
143    Name of the data type of the elements
144
145    scope_catalog sql_identifier
146
147    Applies to a feature not available in PostgreSQL
148
149    scope_schema sql_identifier
150
151    Applies to a feature not available in PostgreSQL
152
153    scope_name sql_identifier
154
155    Applies to a feature not available in PostgreSQL
156
157    maximum_cardinality cardinal_number
158
159    Always null, because arrays always have unlimited maximum cardinality
160    in PostgreSQL
161
162    dtd_identifier sql_identifier
163
164    An identifier of the data type descriptor of the element. This is
165    currently not useful.