UUID Functions
note
This mirror of official PostgreSQL documentation is brought to you by Neon with ❤️
Not all information is applicable to Neon. See Postgres compatibility for details.
Not all information is applicable to Neon. See Postgres compatibility for details.
9.14. UUID Functions #
PostgreSQL includes one function to generate a UUID:
gen_random_uuid () → uuid
This function returns a version 4 (random) UUID. This is the most commonly used type of UUID and is appropriate for most applications.
The uuid-ossp module provides additional functions that implement other standard algorithms for generating UUIDs.
PostgreSQL also provides the usual comparison operators shown in Table 9.1 for UUIDs.