## 37.58. `user_defined_types`

The view `user_defined_types` currently contains all composite types defined in the current database. Only those types are shown that the current user has access to (by way of being the owner or having some privilege).

SQL knows about two kinds of user-defined types: structured types (also known as composite types in Postgres Pro Enterprise) and distinct types (not implemented in Postgres Pro Enterprise). To be future-proof, use the column `user_defined_type_category` to differentiate between these. Other user-defined types such as base types and enums, which are Postgres Pro Enterprise extensions, are not shown here. For domains, see Section 37.22 instead.

Table 37.56. `user_defined_types` Columns

Name | Data Type | Description
--- | --- | ---
`user_defined_type_catalog` | `sql_identifier` | Name of the database that contains the type (always the current database)
`user_defined_type_schema` | `sql_identifier` | Name of the schema that contains the type
`user_defined_type_name` | `sql_identifier` | Name of the type
`user_defined_type_category` | `character_data` | Currently always `STRUCTURED`
`is_instantiable` | `yes_or_no` | Applies to a feature not available in Postgres Pro Enterprise
`is_final` | `yes_or_no` | Applies to a feature not available in Postgres Pro Enterprise
`ordering_form` | `character_data` | Applies to a feature not available in Postgres Pro Enterprise
`ordering_category` | `character_data` | Applies to a feature not available in Postgres Pro Enterprise
`ordering_routine_catalog` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`ordering_routine_schema` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`ordering_routine_name` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`reference_type` | `character_data` | Applies to a feature not available in Postgres Pro Enterprise
`data_type` | `character_data` | Applies to a feature not available in Postgres Pro Enterprise
`character_maximum_length` | `cardinal_number` | Applies to a feature not available in Postgres Pro Enterprise
`character_octet_length` | `cardinal_number` | Applies to a feature not available in Postgres Pro Enterprise
`character_set_catalog` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`character_set_schema` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`character_set_name` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`collation_catalog` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`collation_schema` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`collation_name` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`numeric_precision` | `cardinal_number` | Applies to a feature not available in Postgres Pro Enterprise
`numeric_precision_radix` | `cardinal_number` | Applies to a feature not available in Postgres Pro Enterprise
`numeric_scale` | `cardinal_number` | Applies to a feature not available in Postgres Pro Enterprise
`datetime_precision` | `cardinal_number` | Applies to a feature not available in Postgres Pro Enterprise
`interval_type` | `character_data` | Applies to a feature not available in Postgres Pro Enterprise
`interval_precision` | `cardinal_number` | Applies to a feature not available in Postgres Pro Enterprise
`source_dtd_identifier` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise
`ref_dtd_identifier` | `sql_identifier` | Applies to a feature not available in Postgres Pro Enterprise