UUID generation functions for PostgreSQL
uuid-ossp
extension provides functions for generating Universally Unique Identifiers (UUIDs) in PostgreSQL.
Your Nile database arrives with the uuid-ossp extension already enabled.
public.uuid_generate_v7()
which generates UUIDs with time-ordered
lexicographically sortable strings. It is recommended to use this function for fields that are
used in sorting and indexing.uuid_generate_v4()
, which generates a random UUID:
uuid_generate_v1()
creates a UUID based on the current timestamp and MAC address:
uuid_generate_v3()
creates a UUID based on a namespace and name using MD5:
uuid_generate_v5()
creates a UUID based on a namespace and name using SHA-1: