Skip to main content
Returns a version 4 universally unique identifier (UUID) as defined by RFC-4122 as a TEXT value. This function accepts no arguments.

Syntax

GEN_RANDOM_UUID_TEXT()

Return Type

GEN_RANDOM_UUID_TEXT returns a result of type TEXT.

Example

The following code example generates a random UUID as a TEXT value:
SELECT GEN_RANDOM_UUID_TEXT() AS id_col;
id_col text
e816c961-c73a-4a36-8aaf-40a641106687

Rows: 1Execution time: 5.27ms