Re: UUID v7 - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: UUID v7
Date
Msg-id 6941A45B-C7D4-414B-A3A9-ACED172DFBD5@yandex-team.ru
Whole thread Raw
In response to Re: UUID v7  (Andrey Borodin <amborodin86@gmail.com>)
Responses Re: UUID v7
List pgsql-hackers

> On 9 Oct 2023, at 23:46, Andrey Borodin <amborodin86@gmail.com> wrote:

Here's next iteration of the patch. I've added get_uuid_v7_time().
This function extracts timestamp from uuid, iff it is v7. Timestamp correctness only guaranteed if the timestamp was
generatedby the same implementation (6 bytes for milliseconds obtained by gettimeofday()). 
Tests verify that get_uuid_v7_time(gen_uuid_v7()) differs no more than 1ms from now(). Maybe we should allow more
tolerantvalues for slow test machines. 


Best regards, Andrey Borodin.



Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: Extract numeric filed in JSONB more effectively
Next
From: shveta malik
Date:
Subject: Re: Synchronizing slots from primary to standby