domains

The domains view provides information about all domains defined in the database.

Column name Data type Description
domain_catalog sql_identifier The name of the current database containing the domain.
domain_schema sql_identifier The name of the schema containing the domain.
domain_name sql_identifier The name of the domain.
data_type character_data The data type of the domain. For built-in types, this is the type name.
  • ARRAY – The domain is an array type.
  • USER-DEFINED – The domain uses a user-defined type identified in udt_name and related columns.
character_maximum_length cardinal_number The declared maximum length if the domain has a character or bit string type.
NULL – All other data types or when no maximum was declared.
character_octet_length cardinal_number The maximum possible length, in octets, for character types.
NULL – All other data types.
character_set_catalog sql_identifier Applies to a feature that is not available in PostgreSQL.
character_set_schema sql_identifier Applies to a feature that is not available in PostgreSQL.
character_set_name sql_identifier Applies to a feature that is not available in PostgreSQL.
collation_catalog sql_identifier The name of the current database containing the collation of the domain.
NULL – Default or non-collatable.
collation_schema sql_identifier The name of the schema containing the collation.
NULL – Default or non-collatable.
collation_name sql_identifier The name of the collation.
NULL – Default or non-collatable.
numeric_precision cardinal_number The declared or implicit precision for numeric types (the number of significant digits).
NULL – Non-numeric types.
numeric_precision_radix cardinal_number The base (2 or 10) used to express numeric_precision and numeric_scale.
NULL – Non-numeric types.
numeric_scale cardinal_number The declared or implicit scale for exact numeric types.
NULL – All other data types.
datetime_precision cardinal_number The fractional-seconds precision for date/time/timestamp/interval types.
NULL – All other data types.
interval_type character_data The interval field specification. For example, YEAR TO MONTH.
NULL – Unrestricted or not an interval type.
interval_precision cardinal_number Applies to a feature that is not available in PostgreSQL (see datetime_precision for actual fractional-seconds precision).
domain_default character_data The default expression of the domain.
udt_catalog sql_identifier The name of the current database in which the domain’s underlying data type is defined.
udt_schema sql_identifier The name of the schema in which the domain’s underlying data type is defined.
udt_name sql_identifier The name of the domain’s underlying data type.
scope_catalog sql_identifier Applies to a feature that is not available in PostgreSQL.
scope_schema sql_identifier Applies to a feature that is not available in PostgreSQL.
scope_name sql_identifier Applies to a feature that is not available in PostgreSQL.
maximum_cardinality cardinal_number The maximum cardinality of the array.
Always NULL, because arrays in PostgreSQL have unlimited maximum cardinality.
dtd_identifier sql_identifier An identifier for the domain’s data type descriptor, unique within descriptors belonging to that domain.