Re: UUID v7

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Sergey Prokhorenko <sergeyprokhorenko(at)yahoo(dot)com(dot)au>
Cc: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Michael Paquier <michael(at)paquier(dot)xyz>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, pgsql-hackers mailing list <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Przemysław Sztoch <przemyslaw(at)sztoch(dot)pl>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Mat Arye <mat(at)timescaledb(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, Junwang Zhao <zhjwpku(at)gmail(dot)com>
Subject: Re: UUID v7
Date: 2024-07-28 18:44:22
Message-ID: D8C766FF-A231-46F4-B02F-C7801784B5FD@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 24 Jul 2024, at 04:09, Sergey Prokhorenko <sergeyprokhorenko(at)yahoo(dot)com(dot)au> wrote:
>
> Implementations MAY alter the actual timestamp.

Hmm… looks like we slightly misinterpreted words about clock source.
Well, that’s great, let’s get offset back.
PFA version accepting offset interval.
It works like this:
postgres=# select uuidv7(interval '-2 months’);
018fc02f-0996-7136-aeb4-8936b5a516a1

postgres=# select uuid_extract_timestamp(uuidv7(interval '-2 months'));
2024-05-28 22:11:15.71+05

What do you think?

Best regards, Andrey Borodin.

Attachment Content-Type Size
v26-0001-Implement-UUID-v7.patch application/octet-stream 15.9 KB

In response to

  • Re: UUID v7 at 2024-07-23 23:09:48 from Sergey Prokhorenko

Responses

  • Re: UUID v7 at 2024-08-04 10:50:37 from Andrey M. Borodin

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2024-07-28 19:18:07 Re: Optimize mul_var() for var1ndigits >= 8
Previous Message Tom Lane 2024-07-28 16:59:35 Re: race condition in pg_class