Re: UUID v7

From: Przemysław Sztoch <przemyslaw(at)sztoch(dot)pl>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Sergey Prokhorenko <sergeyprokhorenko(at)yahoo(dot)com(dot)au>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, pgsql-hackers mailing list <pgsql-hackers(at)postgresql(dot)org>, Nick Babadzhanian <pgnickb(at)gmail(dot)com>, Mat Arye <mat(at)timescaledb(dot)com>, 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>, "brad(at)peabody(dot)io" <brad(at)peabody(dot)io>, Kirk Wolak <wolakk(at)gmail(dot)com>
Subject: Re: UUID v7
Date: 2024-01-16 21:02:00
Message-ID: e9f035db-b3ec-110d-326e-fc85e82ccf92@sztoch.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jelte Fennema-Nio wrote on 1/16/2024 9:25 PM:
> On Tue, 16 Jan 2024 at 19:17, Andrey M. Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
> So currently my preference for the function names would be:
>
> - uuidv4() -> alias for gen_random_uuid()
> - uuidv7()
> - uuidv7(timestamptz)
> - uuid_extract_ver(uuid)
> - uuid_extract_var(uuid)
> - uuidv7_extract_time(uuid)
+1
But replaceuuidv7_extract_time(uuid)with uuid_extract_time(uuid) -
function should be able extract timestamp from v1/v6/v7

I would highly recommend to add:
uuidv5(namespace uuid, name text) -> uuid
using uuid_generate_v5 from uuid-ossp extension
(https://www.postgresql.org/docs/current/uuid-ossp.html)
There is an important version and it should be included into the main PG
code.

Jelte: Please propose the name of the function that will convert uuid
from version 1 to 6.
v6 is almost as good as v7 for indexes. And v6 allows you to convert
from v1 which some people use.
--
Przemysław Sztoch | Mobile +48 509 99 00 66

In response to

  • Re: UUID v7 at 2024-01-16 20:25:58 from Jelte Fennema-Nio

Responses

  • Re: UUID v7 at 2024-01-16 21:19:31 from Jelte Fennema-Nio

Browse pgsql-hackers by date

  From Date Subject
Next Message Przemysław Sztoch 2024-01-16 21:09:56 Re: UUID v7
Previous Message Robert Haas 2024-01-16 20:49:20 Re: cleanup patches for incremental backup