GEN_RANDOM_UUID
Generates a random UUID — a unique identifier like 3f2c9a1e-….
Syntax
GEN_RANDOM_UUID()
Returns a version 4 UUID: 32 randomly generated hexadecimal digits with hyphens. The chance of two identical ones is negligible, so such keys can be created anywhere — in the database or in the application — without coordination. Most often they're used as a default value: id uuid PRIMARY KEY DEFAULT gen_random_uuid().