Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
9.14. UUID Functions
Prev UpChapter 9. Functions and OperatorsHome Next

9.14. UUID Functions#

Postgres Pro 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.

Theuuid-ossp module provides additional functions that implement other standard algorithms for generating UUIDs.

There are also functions to extract data from UUIDs:

uuid_extract_timestamp (uuid) →timestamp with time zone

This function extracts atimestamp with time zone from UUID version 1. For other versions, this function returns null. Note that the extracted timestamp is not necessarily exactly equal to the time the UUID was generated; this depends on the implementation that generated the UUID.

uuid_extract_version (uuid) →smallint

This function extracts the version from a UUID of the variant described byRFC 4122. For other variants, this function returns null. For example, for a UUID generated bygen_random_uuid, this function will return 4.

Postgres Pro also provides the usual comparison operators shown inTable 9.1 for UUIDs.


Prev Up Next
9.13. Text Search Functions and Operators Home 9.15. XML Functions
pdfepub
Go to Postgres Pro Standard 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp