Re: UUID v7

From: Mat Arye <mat(at)timescaledb(dot)com>
To: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, "Kyzer Davis (kydavis)" <kydavis(at)cisco(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Andrey Borodin <amborodin86(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, "brad(at)peabody(dot)io" <brad(at)peabody(dot)io>, "wolakk(at)gmail(dot)com" <wolakk(at)gmail(dot)com>, sergeyprokhorenko(at)yahoo(dot)com(dot)au
Subject: Re: UUID v7
Date: 2023-08-31 15:32:36
Message-ID: CADsUR0CR7FioUWdA5QaVKij6_BE_en4tPA+pdCWQvN8hy0m+Pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrey,

Thanks for all your work on this. I think this will be really useful.

From a user perspective, it would be great to add 2 things:
- A function to extract the timestamp from a V7 UUID (very useful for
defining constraints if partitioning by the uuid-embedded timestamps, for
instance).
- Can we add an optional timestamptz argument to gen_uuid_v7 so that you
can explicitly specify a time instead of always generating for the current
time? If the argument is NULL, then use current time. This could be useful
for backfilling and other applications.

Thanks,
Matvey Arye
Timescale software developer.

On Wed, Aug 30, 2023 at 3:05 PM Andrey M. Borodin <x4mmm(at)yandex-team(dot)ru>
wrote:

>
>
> > On 21 Aug 2023, at 13:42, Andrey M. Borodin <x4mmm(at)yandex-team(dot)ru>
> wrote:
> >
> >
> <v5-0001-Implement-UUID-v7-as-per-IETF-draft.patch><v5-0002-Buffer-random-numbers.patch><v5-0003-Use-cached-random-numbers-in-gen_random_uuid-too.patch>
>
> FPA attached next version.
> Changes:
> - implemented protection from time leap backwards when series is generated
> on the same backend
> - counter overflow is now translated into ms step forward
>
>
> Best regards, Andrey Borodin.
>

In response to

  • Re: UUID v7 at 2023-08-30 19:04:46 from Andrey M. Borodin

Responses

  • Re: UUID v7 at 2023-08-31 18:51:35 from Andrey M. Borodin

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-08-31 15:48:58 Re: should frontend tools use syncfs() ?
Previous Message Peter Eisentraut 2023-08-31 15:28:57 Re: Replace some cstring_to_text to cstring_to_text_with_len