Postgresql 中文操作指南
9.14. UUID Functions #
PostgreSQL 包含一个函数以生成 UUID:
PostgreSQL includes one function to generate a UUID:
gen_random_uuid () → uuid
此函数返回版本 4(随机)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.
uuid-ossp模块提供了实现其他标准算法以生成 UUID 的附加函数。
The uuid-ossp module provides additional functions that implement other standard algorithms for generating UUIDs.
PostgreSQL 还提供了 Table 9.1 中所示的用于 UUID 的常用比较运算符。
PostgreSQL also provides the usual comparison operators shown in Table 9.1 for UUIDs.