Re: Support UUIDv6 in uuid_extract_timestamp()

From: Miłosz Bieniek <bieniek(dot)milosz(at)proton(dot)me>
To: Tristan Partin <tristan(at)partin(dot)io>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support UUIDv6 in uuid_extract_timestamp()
Date: 2026-07-26 16:38:14
Message-ID: 2udO1NOFp85l2YgakmdxlSFHD-vpDXvui0oVb0RtTv-UJl1rz_zJfibRIAdvvqr5Rtq_kJd9j2AnLn1b6QnCVxrBX8m7BhFnAMQOPo9vTzY=@proton.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Sunday, 26 July 2026 at 18:05, Tristan Partin <tristan(at)partin(dot)io> wrote:

> UUIDv6 is the same as UUIDv1 with some fields reordered. We already
> supported UUIDv1, so let's add support for UUIDv6. Previously, calls to
> uuid_extract_timestamp() would return NULL for UUIDv6 values.

Makes sense, this would be the last missing piece in uuid_extract_timestamp(). The code itself looks good.

> Patch 2 only adds comments. I think the bit manipulation is worthy of
> comments, but others may disagree.

I think it's a good idea. Now it's much easier to understand what's going on with these wild manipulations.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-07-26 17:33:26 Re: remove_useless_joins vs. bug #19560
Previous Message solai v 2026-07-26 16:15:48 Re: Restore vacuum_delay_point() in GIN posting-tree leaf vacuum