2. SQL Data Types : Data Types : Universal Unique Identifier (UUID)
 
Share this page                  
Universal Unique Identifier (UUID)
A Universal Unique Identifier (UUID) is a 128 bit, unique identifier generated by the local system upon request or loaded from external sources.
The database can generate UUID values with the uuid_create() function. Existing UUID values can be loaded from external sources using the uuid_from_char type conversion. The system cannot guarantee uniqueness of these external values, but when used correctly, the algorithms used to create the values will guarantee it.
The identifier is unique across both space and time with respect to the space of all UUIDs. UUID values generated are Version 1 (time-based) UUIDs.
A UUID can be used to tag records to ensure that the database records are uniquely identified regardless of which database they are stored in, for example, in a system where there are two separate physical databases containing accounting data from two different physical locations.
No centralized authority is responsible for assigning UUIDs. They can be generated on demand (10 million per second per machine if needed).
A UUID can be used for multiple purposes:
Tagging objects that have a brief life
Reliably identifying persistent objects across a network
Assigning as unique values to transactions as transaction IDs in a distributed system
UUIDs are fixed sized (128 bits), which is small relative to other alternatives. This fixed small size lends itself well to sorting, ordering, and hashing of all sorts, sorting in databases, simple allocation, and ease of programming.