## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> UUIDV4[UUIDV4]:::quoted UUIDV4 --> End((END)) ``` ## Purpose The `UUIDV4` SQL function creates a new random UUID of version 4. It is another name for [[NEWID]] and the same function as [[GEN_RANDOM_UUID]], under the name PostgreSQL 18 gives it. Available from release 28.0. See also [[UUIDV7]], [[UUID_EXTRACT_VERSION]] and [[NEWID]]. Returns: the new UUID, of data type `guid`. Each call creates a UUID of its own. ## Examples The following example creates a new random UUID and reads its version: ```sql select uuid_extract_version(uuidv4()) version ------- 4 ```