Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
36.23. element_types
Prev UpChapter 36. The Information SchemaHome Next

36.23. element_types

The viewelement_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 containsARRAY in the columndata_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_typeFROM 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 36.21. element_types Columns

NameData TypeDescription
object_catalogsql_identifier Name of the database that contains the object that uses the array being described (always the current database)
object_schemasql_identifier Name of the schema that contains the object that uses the array being described
object_namesql_identifier Name of the object that uses the array being described
object_typecharacter_data The type of the object that uses the array being described: one ofTABLE (the array is used by a column of that table),USER-DEFINED TYPE (the array is used by an attribute of that composite type),DOMAIN (the array is used by that domain),ROUTINE (the array is used by a parameter or the return data type of that function).
collection_type_identifiersql_identifier The identifier of the data type descriptor of the array being described. Use this to join with thedtd_identifier columns of other information schema views.
data_typecharacter_data Data type of the array elements, if it is a built-in type, elseUSER-DEFINED (in that case, the type is identified inudt_name and associated columns).
character_maximum_lengthcardinal_numberAlways null, since this information is not applied to array element data types inPostgreSQL
character_octet_lengthcardinal_numberAlways null, since this information is not applied to array element data types inPostgreSQL
character_set_catalogsql_identifierApplies to a feature not available inPostgreSQL
character_set_schemasql_identifierApplies to a feature not available inPostgreSQL
character_set_namesql_identifierApplies to a feature not available inPostgreSQL
collation_catalogsql_identifier 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
collation_schemasql_identifier Name of the schema containing the collation of the element type, null if default or the data type of the element is not collatable
collation_namesql_identifier Name of the collation of the element type, null if default or the data type of the element is not collatable
numeric_precisioncardinal_numberAlways null, since this information is not applied to array element data types inPostgreSQL
numeric_precision_radixcardinal_numberAlways null, since this information is not applied to array element data types inPostgreSQL
numeric_scalecardinal_numberAlways null, since this information is not applied to array element data types inPostgreSQL
datetime_precisioncardinal_numberAlways null, since this information is not applied to array element data types inPostgreSQL
interval_typecharacter_dataAlways null, since this information is not applied to array element data types inPostgreSQL
interval_precisioncardinal_numberAlways null, since this information is not applied to array element data types inPostgreSQL
domain_defaultcharacter_dataNot yet implemented
udt_catalogsql_identifier Name of the database that the data type of the elements is defined in (always the current database)
udt_schemasql_identifier Name of the schema that the data type of the elements is defined in
udt_namesql_identifier Name of the data type of the elements
scope_catalogsql_identifierApplies to a feature not available inPostgreSQL
scope_schemasql_identifierApplies to a feature not available inPostgreSQL
scope_namesql_identifierApplies to a feature not available inPostgreSQL
maximum_cardinalitycardinal_numberAlways null, because arrays always have unlimited maximum cardinality inPostgreSQL
dtd_identifiersql_identifier An identifier of the data type descriptor of the element. This is currently not useful.


Prev Up Next
36.22. domains Home 36.24. enabled_roles
epubpdf
Go to PostgreSQL 10
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp