Re: UUID v7

Поиск
Список
Период
Сортировка
От Andrey M. Borodin
Тема Re: UUID v7
Дата
Msg-id D8C766FF-A231-46F4-B02F-C7801784B5FD@yandex-team.ru
обсуждение исходный текст
Ответ на Re: UUID v7  (Sergey Prokhorenko <sergeyprokhorenko@yahoo.com.au>)
Ответы Re: UUID v7
Список pgsql-hackers

> On 24 Jul 2024, at 04:09, Sergey Prokhorenko <sergeyprokhorenko@yahoo.com.au> wrote:
>
> Implementations MAY alter the actual timestamp.

Hmm… looks like we slightly misinterpreted words about clock source.
Well, that’s great, let’s get offset back.
PFA version accepting offset interval.
It works like this:
postgres=# select uuidv7(interval '-2 months’);
 018fc02f-0996-7136-aeb4-8936b5a516a1


postgres=# select uuid_extract_timestamp(uuidv7(interval '-2 months'));
 2024-05-28 22:11:15.71+05

What do you think?


Best regards, Andrey Borodin.

Вложения

В списке pgsql-hackers по дате отправления: