Re: UUID v7 - Mailing list pgsql-hackers

From Andrey M. Borodin
Subject Re: UUID v7
Date
Msg-id C80B8FDB-8D9E-48A2-82A2-48863987A1B1@yandex-team.ru
Whole thread Raw
In response to Re: UUID v7  (Mat Arye <mat@timescaledb.com>)
Responses Re: UUID v7
Re: UUID v7
List pgsql-hackers
Thanks for interesting ideas, Mat!

> On 31 Aug 2023, at 20:32, Mat Arye <mat@timescaledb.com> wrote:
>
> 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-embeddedtimestamps, for instance). 

Well, as far as I know, RFC discourages extracting timestamps from UUIDs. But we still can have such functions...maybe
asan extension? 

> - Can we add an optional timestamptz argument to gen_uuid_v7 so that you can explicitly specify a time instead of
alwaysgenerating for the current time? If the argument is NULL, then use current time. This could be useful for
backfillingand other applications. 

I think this makes sense. We could also have a counter as an argument. I'll try to implement that.
However, so far I haven't figured out how to implement optional arguments for catalog functions. I'd appreciate any
pointershere. 


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Schema variables - new implementation for Postgres 15
Next
From: Bruce Momjian
Date:
Subject: Suppressing compiler warning on Debian 12/gcc 12.2.0