GUID/UUID Type

Data Type Size Size (Not Null) Synonyms
UUID 17 bytes 16 bytes GUID

The data type UUID or GUID stores Universally Unique Identifiers (UUID) as defined by RFC 4122, ISO/IEC 9834-8:2005, and related standards. This identifier is a 128-bit quantity that is generated by an algorithm chosen to make it very unlikely that the same identifier will be generated by anyone else in the known universe using the same algorithm. Therefore, for distributed systems, these identifiers provide a better uniqueness guarantee than sequence generators, which are only unique within a single database.

A UUID is written as a sequence of lower-case hexadecimal digits, in several groups separated by hyphens, specifically a group of 8 digits followed by three groups of 4 digits followed by a group of 12 digits, for a total of 32 digits representing the 128 bits.

The types UUID and GUID are equivalent.

Examples

create table t1
(
   id uuid default auto primary key,
   type uint16 not null,
   model char(20),
   desc clob
);   

The schema above will create a UUID as a PRIMARY KEY. The DEFAULT AUTO clause will generate a new UUID if one is not provided when a new row is created.

See Also

Functions

NULL Values

DEFAULT Values

Limitations