Re: Protect against timestamp underflow in uuidv7(interval)

From: Baji Shaik <baji(dot)pgdev(at)gmail(dot)com>
To: Tristan Partin <tristan(at)partin(dot)io>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Protect against timestamp underflow in uuidv7(interval)
Date: 2026-06-23 23:57:24
Message-ID: CA+fm-RPUtUqR90-jBtKkQY_xtgdoA64Q=-Bgi8+o-fiYA5ZxmQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 23, 2026 at 6:39 PM Tristan Partin <tristan(at)partin(dot)io> wrote:

> We were silently allowing underflowing the generated timestamp for the
> UUIDv7 value:
>
> # SELECT uuid_extract_timestamp(uuidv7('-57 years'::interval));
> uuid_extract_timestamp
> -----------------------------
> 10889-01-23 04:02:36.375+00
> (1 row)
>

Thank you, Tristan.
This has been reported and is being discussed here [1]

[1]:
https://www.postgresql.org/message-id/CA%2Bfm-RN4eMEr2tzZU_mAV-%3DWfdmPXJ4Ea_GpmSS8%3DyStSy8onQ%40mail.gmail.com

Thanks,
Baji Shaik.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2026-06-24 00:01:46 Re: Why clearing the VM doesn't require registering vm buffer in wal record
Previous Message Melanie Plageman 2026-06-23 23:55:21 Re: Why clearing the VM doesn't require registering vm buffer in wal record