Re: UUID v7

Przemysław Sztoch <przemyslaw@sztoch.pl>

From: Przemysław Sztoch <przemyslaw@sztoch.pl>
To: Masahiko Sawada <sawada.mshk@gmail.com>, Sergey Prokhorenko <sergeyprokhorenko@yahoo.com.au>
Cc: "Andrey M. Borodin" <x4mmm@yandex-team.ru>, Jelte Fennema-Nio <postgres@jeltef.nl>, Michael Paquier <michael@paquier.xyz>, Aleksander Alekseev <aleksander@timescale.com>, pgsql-hackers mailing list <pgsql-hackers@postgresql.org>, Peter Eisentraut <peter@eisentraut.org>, "David G. Johnston" <david.g.johnston@gmail.com>, Mat Arye <mat@timescaledb.com>, Matthias van de Meent <boekewurm+postgres@gmail.com>, Nikolay Samokhvalov <samokhvalov@gmail.com>, Junwang Zhao <zhjwpku@gmail.com>, Stepan Neretin <sncfmgg@gmail.com>
Date: 2024-11-26T19:35:01Z
Lists: pgsql-hackers
A lot of people use https://www.postgresql.org/docs/current/uuid-ossp.html.

|And `uuid_generate_v7()` will be the continuation...|

|From my point of view, absorbing uuid_generate_v5 into mainline would 
be a great move too.
|

On 26.11.2024 20:30, Masahiko Sawada wrote:
> On Tue, Nov 26, 2024 at 11:11 AM Sergey Prokhorenko
> <sergeyprokhorenko@yahoo.com.au> wrote:
>> Changing the name uuidv7() to uuid_v7() is a bad idea because the RFC 9562 uses the term UUIDv7, and therefore code containing uuid_v7() will not be found by searching the web in most cases.
>>
>> It makes much more sense to rename it to get_uuidv7(), so that a query for "uuidv7" does not return a bunch of other unnecessary functions related to UUIDv7.
> Thank you for pointing it out. How about gen_uuidv7() and gen_uuidv4()
> as we already have gen_random_uuid()?
>
> Regards,
>
-- 
Przemysław Sztoch | Mobile +48 509 99 00 66

Commits

  1. Fix timestamp overflow in UUIDv7 implementation.

  2. Add UUID version 7 generation function.

  3. Add some UUID support functions