9.14. UUID Functions
UUID Functions
Generation Functions shows the PostgreSQL functions that can be used to generate UUIDs.
Function Description Example(s) |
|---|
Generates a version 4 (random) UUID
|
Generates a version 7 (time-ordered) UUID. The timestamp is computed using UNIX timestamp with millisecond precision + sub-millisecond timestamp + random. The optional parameter
|
: UUID Generation Functions
The F.49. uuid-ossp — a UUID generator module provides additional functions that implement other standard algorithms for generating UUIDs.
Extraction Functions shows the PostgreSQL functions that can be used to extract information from UUIDs.
Function Description Example(s) |
|---|
Extracts a
|
Extracts the version from a UUID of one of the variants described by RFC 9562. For other variants, this function returns null. For example, for a UUID generated by
|
: UUID Extraction Functions
PostgreSQL also provides the usual comparison operators shown in Comparison Operators for UUIDs.
See UUID Type for details on the data type uuid in PostgreSQL.