pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedFrom: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: theshallow27@gmail.com
Subject: BUG #19738: `uuidv7(interval)` rejects sub-millisecond timestamps within the final 48-bit millisecond
Date: Fri, 02 Oct 2026 22:36:49 +0000
Message-ID: <19738-659d03aaa312f3b8@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 19738
Logged by: Shallow
Email address: theshallow27@gmail.com
PostgreSQL version: 18.6
Operating system: Linux
Description:
UUIDv7 stores a 48-bit Unix-millisecond timestamp, and PostgreSQL's
documentation says its timestamp also includes sub-millisecond precision. A
shifted timestamp 250 microseconds into the final representable millisecond
is
rejected as out of range, although its millisecond field is still the
maximum
valid value.
**Reproduction:**
```sql
SELECT uuidv7(
(timestamptz '1970-01-01 UTC'
+ interval '281474976710655 milliseconds'
+ interval '250 microseconds')
- clock_timestamp()
);
```
**Actual result:** SQLSTATE `22008`, `timestamp out of range for UUID
version 7`.
**Expected result:** Generate a UUIDv7 whose 48-bit millisecond timestamp is
`2^48 - 1`, preserving the permitted sub-millisecond component.
view thread (4+ messages) latest in thread
Message-ID: <19738-659d03aaa312f3b8@postgresql.org>
Permalink: ../19738-659d03aaa312f3b8@postgresql.org/
Also on: postgresql.org/message-id/19738-659d03aaa312f3b8@postgresql.org
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, theshallow27@gmail.com
Subject: Re: BUG #19738: `uuidv7(interval)` rejects sub-millisecond timestamps within the final 48-bit millisecond
In-Reply-To: <19738-659d03aaa312f3b8@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox