Distinct data types

A distinct data type is an encapsulated data type that you create with the CREATE DISTINCT TYPE statement. A distinct data type has the same representation as, but is distinct from, the data type on which it is based. You can create a distinct data type from built-in types, opaque types, named row types, or other distinct types. You cannot create a distinct data type from any of the following data types:
  • BIGSERIAL, SERIAL, and SERIAL8
  • Collection types
  • Unnamed row types

When you create a distinct data type, you implicitly define the structure of the data type because a distinct data type inherits the structure of its source data type. You can also define functions, operators, and aggregates that operate on the distinct data type.

For information about distinct data types, see Cast distinct data types, the HCL OneDB™ Guide to SQL: Syntax, and the HCL OneDB Guide to SQL: Reference.