Re: Fix for typo in UUIDv7 timestamp extraction

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Erik Nordström <erik(at)tigerdata(dot)com>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix for typo in UUIDv7 timestamp extraction
Date: 2025-08-15 18:44:53
Message-ID: CAD21AoBe1hYREDrP6JLPRF_8bh0VsBxyrNw4Y7tnL-_uwzGMLw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 14, 2025 at 5:10 AM Erik Nordström <erik(at)tigerdata(dot)com> wrote:
>
>
>
> On Wed, Aug 13, 2025 at 11:52 AM Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>>
>> Hi Erik!
>>
>> > On 13 Aug 2025, at 11:05, Erik Nordström <erik(at)tigerdata(dot)com> wrote:
>> >
>> > 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.
>>
>> Wow, that's a very good level of proofreading! Yes, you are correct, it's must be US_PER_MS.
>>
>> >
>> > Anyway, attaching a patch to fix this typo.
>>
>> LGTM.
>
>
> Ok, maybe a committer would like to commit this change immediately?

Thank you for the report! I'll push the patch to master and v18 shortly.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-08-15 18:46:39 Re: shmem_startup_hook called twice on Windows
Previous Message Masahiko Sawada 2025-08-15 18:29:24 Re: memory leak in logical WAL sender with pgoutput's cachectx