Re: Fix for typo in UUIDv7 timestamp extraction - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Fix for typo in UUIDv7 timestamp extraction
Date
Msg-id CAD21AoBe1hYREDrP6JLPRF_8bh0VsBxyrNw4Y7tnL-_uwzGMLw@mail.gmail.com
Whole thread Raw
In response to Re: Fix for typo in UUIDv7 timestamp extraction  (Erik Nordström <erik@tigerdata.com>)
Responses Re: Fix for typo in UUIDv7 timestamp extraction
List pgsql-hackers
On Thu, Aug 14, 2025 at 5:10 AM Erik Nordström <erik@tigerdata.com> wrote:
>
>
>
> On Wed, Aug 13, 2025 at 11:52 AM Andrey Borodin <x4mmm@yandex-team.ru> wrote:
>>
>> Hi Erik!
>>
>> > On 13 Aug 2025, at 11:05, Erik Nordström <erik@tigerdata.com> wrote:
>> >
>> > I think I found a small typo in the function that extracts a timestamp from a UUIDv7 (uuid_extract_timestamp).
UnlessI 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



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: memory leak in logical WAL sender with pgoutput's cachectx
Next
From: Nathan Bossart
Date:
Subject: Re: shmem_startup_hook called twice on Windows