Skip to main content

Categories: Datatype, UUID Type

GENERATE_UUID Preview

Generates a random UUID version 4 (RFC 4122) value. Returns a native UUID type that can be used directly in UUID columns or cast to other types.

Syntax

GENERATE_UUID() → UUID

Examples

GENERATE_UUID example
SELECT GENERATE_UUID()
-- 550e8400-e29b-41d4-a716-446655440000