]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix constant when extracting timestamp from UUIDv7.
authorMasahiko Sawada <msawada@postgresql.org>
Fri, 15 Aug 2025 18:58:56 +0000 (11:58 -0700)
committerMasahiko Sawada <msawada@postgresql.org>
Fri, 15 Aug 2025 18:58:56 +0000 (11:58 -0700)
commit83773eaf657898a0c747deac7da37516124347c1
tree63302a019244518b6dfd515b866306f7ff043285
parentad3990ffea7e1fb756e2f9c72eac8c5fe9fc2d86
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@tigerdata.com>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/CACAa4V+i07eaP6h4MHNydZeX47kkLPwAg0sqe67R=M5tLdxNuQ@mail.gmail.com
Backpatch-through: 18
src/backend/utils/adt/uuid.c