## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> UUID_GENERATE_V1[UUID_GENERATE_V1]:::quoted UUID_GENERATE_V1 --> End((END)) ``` ## Purpose The `UUID_GENERATE_V1` SQL function creates a new UUID of version 1 (RFC 9562) for the current time. The UUID holds the time of creation in units of 100 nanoseconds since 1582-10-15, which [[UUID_EXTRACT_TIMESTAMP]] reads back. Unlike the function of the same name in the `uuid-ossp` extension of PostgreSQL, the UUID never holds the MAC address of the machine, since that would reveal the host. The node is a random number with the multicast bit set, which no MAC address has, chosen once per process, as RFC 9562 prescribes where no MAC address is used. For that reason [[UUID_GENERATE_V1MC]] is the same function. The UUIDs made by one process are all different and in the order of their creation. A version 1 UUID does not sort by time as text; use [[UUIDV7]] or [[UUID_GENERATE_V6]] for an ID which does. Available from release 28.0. See also [[UUID_GENERATE_V6]], [[UUIDV7]], [[UUID_EXTRACT_TIMESTAMP]] and [[UUID_EXTRACT_VERSION]]. Returns: the new UUID, of data type `guid`. Each call creates a UUID of its own, also within one row or one statement. ## Examples The following example creates a new UUID of version 1 and reads its version: ```sql select uuid_extract_version(uuid_generate_v1()) version ------- 1 ``` The following example creates a new UUID of version 1. The actual value differs per invocation: ```sql select uuid_generate_v1() ------------------------------------ 3f1d6a40-1ee5-11f1-8a4c-9b2f6c0d17e3 ```