Quick Start
Step 1: Enable Extension
Enable the extension in your database:Step 2: Generate UUIDs
Generate a random Version 4 UUID (most common):Step 3: Use as Primary Key
Create a table using UUID as the primary key with a default value:Functions
| Function | Return Type | Description |
|---|---|---|
uuid_generate_v1() | uuid | Generates a version 1 UUID using MAC address and timestamp. |
uuid_generate_v1mc() | uuid | Generates a version 1 UUID using a random multicast MAC address. |
uuid_generate_v3(namespace, name) | uuid | Generates a deterministic version 3 UUID (MD5) from namespace and name. |
uuid_generate_v4() | uuid | Generates a random version 4 UUID. |
uuid_generate_v5(namespace, name) | uuid | Generates a deterministic version 5 UUID (SHA-1) from namespace and name. Preferred over v3. |