Re: UUID v7 - Mailing list pgsql-hackers

From Przemysław Sztoch
Subject Re: UUID v7
Date
Msg-id e9f035db-b3ec-110d-326e-fc85e82ccf92@sztoch.pl
Whole thread Raw
In response to Re: UUID v7  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Responses Re: UUID v7
List 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@yandex-team.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 replace uuidv7_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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: cleanup patches for incremental backup
Next
From: Przemysław Sztoch
Date:
Subject: Re: UUID v7