pgsql: Fix constant when extracting timestamp from UUIDv7.

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix constant when extracting timestamp from UUIDv7.
Date: 2025-08-15 18:59:30
Message-ID: E1umzeD-0002DN-33@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix constant when extracting timestamp from UUIDv7.

When extracting a timestamp from a UUIDv7, a conversion from
milliseconds to microseconds was using the incorrect constant
NS_PER_US instead of US_PER_MS. Although both constants have the same
value, this fix improves code clarity by using the semantically
correct constant.

Backpatch to v18, where UUIDv7 was introduced.

Author: Erik Nordström <erik(at)tigerdata(dot)com>
Reviewed-by: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Reviewed-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Discussion: https://postgr.es/m/CACAa4V+i07eaP6h4MHNydZeX47kkLPwAg0sqe67R=M5tLdxNuQ@mail.gmail.com
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/37265ca01f0f361a3aff23e27dfc81b66057a039

Modified Files
--------------
src/backend/utils/adt/uuid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2025-08-15 18:59:34 pgsql: Fix constant when extracting timestamp from UUIDv7.
Previous Message Peter Eisentraut 2025-08-15 08:39:10 pgsql: Fix git whitespace warning