From: | Erik Nordström <erik(at)tigerdata(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Fix for typo in UUIDv7 timestamp extraction |
Date: | 2025-08-13 08:05:04 |
Message-ID: | CACAa4V+i07eaP6h4MHNydZeX47kkLPwAg0sqe67R=M5tLdxNuQ@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
I think I found a small typo in the function that extracts a timestamp from
a UUIDv7 (uuid_extract_timestamp). Unless I am mistaken, the constant
US_PER_MS should be used instead of NS_PER_US when converting milliseconds
to microseconds. Fortunately, these constants are the same so the
calculation is still correct.
Anyway, attaching a patch to fix this typo.
On a related note, I am wondering why this function doesn't extract and use
the sub-millisecond information in the rand_a bits? These bits are added
when generating the UUID, but they don't seem to be extracted. Hopefully
somebody could shed some light on this and whether it would be a worthwhile
addition.
Thank you,
- Erik
Attachment | Content-Type | Size |
---|---|---|
0001-Fix-constant-when-extracting-timestamp-from-UUIDv7.patch | text/x-patch | 1.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Nazir Bilal Yavuz | 2025-08-13 08:05:23 | Re: meson: Add _static and _shared suffixes to the library names |
Previous Message | Wolfgang Walther | 2025-08-13 07:50:25 | Re: meson: Add _static and _shared suffixes to the library names |