↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Functions

uuidv7

Generates a version 7 (time-ordered) UUID. The timestamp is computed using UNIX timestamp with millisecond precision + sub-millisecond timestamp + random. The optional parameter shift will shift the computed timestamp by the given interval. Infinite interval values are not accepted. The shifted timestamp must fall within the range supported by UUID version 7's 48-bit millisecond timestamp field: from 1970-01-01 00:00:00 UTC to approximately year 10889. An error is raised if the resulting timestamp is outside this range.

English manual coverage begins with PostgreSQL 7.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

group
uuid
group label
UUID 函数
lang
en
layout
table-new
pages
functions-uuid.html
prose only
false

Definition PG 18

Generates a version 7 (time-ordered) UUID. The timestamp is computed using UNIX timestamp with millisecond precision + sub-millisecond timestamp + random. The optional parameter shift will shift the computed timestamp by the given interval. Infinite interval values are not accepted. The shifted timestamp must fall within the range supported by UUID version 7's 48-bit millisecond timestamp field: from 1970-01-01 00:00:00 UTC to approximately year 10889. An error is raised if the resulting timestamp is outside this range.

Signatures and overloads

uuidv7 ( [shift interval] ) → uuid → uuid
Generates a version 7 (time-ordered) UUID. The timestamp is computed using UNIX timestamp with millisecond precision + sub-millisecond timestamp + random. The optional parameter shift will shift the computed timestamp by the given interval. Infinite interval values are not accepted. The shifted timestamp must fall within the range supported by UUID version 7's 48-bit millisecond timestamp field: from 1970-01-01 00:00:00 UTC to approximately year 10889. An error is raised if the resulting timestamp is outside this range.

Compare versions

Complete source facts

documentation revision

{"inputs":[{"file":"functions-uuid.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"1145bc769b573b2bdb5619ef98fc49d54db67f2fe7bd4bec69f14c025e66453c","version":"18.7"},{"file":"functions-uuid.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"59821fb93e96c7c39838320986580f60a79cc09b1cd2d8ab9bb738768941e05a","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"}

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · wiki-repair-20261023:e685881d1af92d373d8d091d95d78ad0fc30883803cf953bf40b57e632528e01

Text language: en · wiki-repair-20261023:e685881d1af92d373d8d091d95d78ad0fc30883803cf953bf40b57e632528e01