Re: UUID v7 - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: UUID v7
Date
Msg-id 1ED19D0E-BDA6-4B1B-9722-2322B69CE151@yandex-team.ru
Whole thread Raw
In response to Re: UUID v7  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Responses Re: UUID v7
Re: UUID v7
List pgsql-hackers

> On 17 Jan 2024, at 02:19, Jelte Fennema-Nio <postgres@jeltef.nl> wrote:

I want to ask Kyzer or Brad, I hope they will see this message. I'm working on the patch for time extraction for v1, v6
andv7. 

Do I understand correctly, that UUIDs contain local time, not UTC time? For examples in [0] I see that "A.6. Example of
aUUIDv7 Value" I see that February 22, 2022 2:22:22.00 PM GMT-05:00 results in unix_ts_ms = 0x017F22E279B0, which is
notUTC, but local time. 
Is it intentional? Section "5.1. UUID Version 1" states otherwise.

If so, I should swap signatures of functions from TimestampTz to Timestamp.
I'm hard-coding examples from this standard to tests, so I want to be precise...

If I follow the standard I see this in tests:
+-- extract UUID v1, v6 and v7 timestamp
+SELECT uuid_extract_time('C232AB00-9414-11EC-B3C8-9F6BDECED846') at time zone 'GMT-05';
+         timezone
+--------------------------
+ Wed Feb 23 00:22:22 2022
+(1 row)

Current patch version attached. I've addressed all other requests: function renames, aliases, multiple functions
insteadof optional params, cleaner catalog definitions, not throwing error when [var,ver,time] value is unknown. 
What is left: deal with timezones, improve documentation.


Best regards, Andrey Borodin.

[0] https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-example-of-a-uuidv1-value

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: remaining sql/json patches
Next
From: Yongtao Huang
Date:
Subject: Fix incorrect format placeholders in walreceiver.c