pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Baji Shaik <baji.pgdev@gmail.com>
Cc: Zsolt Parragi <zsolt.parragi@percona.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: uuidv7 improperly accepts dates before 1970-01-01
Date: Thu, 16 Jul 2026 12:23:08 -0700
Message-ID: <CAD21AoBQQS0HqvCGwa-g3p5wC4MPUo-rHGKT6+MEnsY8uOMCJQ@mail.gmail.com> (raw)
In-Reply-To: <CA+fm-RMG8QU5sWuw62rhuz=32LRxPDYgLxbtBWCWRD1=ztRq1g@mail.gmail.com>
References: <799A70FA-6E5C-4118-99EB-2FBBE1CBAC54@thebuild.com>
	<966B5430-8ECD-48FA-B56F-22452D9CDBBF@yandex-team.ru>
	<E3B0C0EF-E9F3-4DCE-9F36-0C048E1D46D6@thebuild.com>
	<CAD21AoAJN-Yb1mP5W-95UWQNMPgcE6OzCyJLKJRqTRrU5WxH5Q@mail.gmail.com>
	<CA+fm-ROd4cNKM524n6EdgtZ9xOzOHJDNv8J_9Mvr2+2t1qWSDw@mail.gmail.com>
	<CAD21AoBpxjp3wjQ4dia0c76Bp8E=Q4UOgBTU4ZOn3Sj6k=-SsA@mail.gmail.com>
	<CA+fm-RN4eMEr2tzZU_mAV-=WfdmPXJ4Ea_GpmSS8=yStSy8onQ@mail.gmail.com>
	<CAN4CZFP9XsTXijqxtK7v9Hgad3jQN-m+wBve0azdi3QkheJv7Q@mail.gmail.com>
	<CA+fm-RPjp8fC-w50PApyhrfMqY4SA0zT5s1Nq=+03+ALcf+3+A@mail.gmail.com>
	<20260625.111954.696627555349573162.horikyota.ntt@gmail.com>
	<CA+fm-RN9UgAG2ew7T0Gum8RtZ4ZbyYvOLyyqAiuTWhsGEn3_zw@mail.gmail.com>
	<CAD21AoDAx5ArZ_Fpp1u6VmPS26GsqBB_PEaf9yF4U9U+fd3yBQ@mail.gmail.com>
	<CA+fm-RM5sNuGrufK7cMstQu=3BJrXxLzsMYp6GGiKBOBn2cE4g@mail.gmail.com>
	<CAN4CZFOupdhpOwOJBKpG2F4tJ6WgmoNHMXSAwOZXV=6SpVb_yw@mail.gmail.com>
	<CA+fm-RPAMxA_+h5q=_TShnQ9dooD8OLsebeBsSnsH2GOi+HtTw@mail.gmail.com>
	<CAD21AoBZ=Vragb3wNt++XXYSc3mtptrCqT5W==wSVB2LqUVe2w@mail.gmail.com>
	<CA+fm-RMG8QU5sWuw62rhuz=32LRxPDYgLxbtBWCWRD1=ztRq1g@mail.gmail.com>

On Thu, Jul 16, 2026 at 8:01 AM Baji Shaik <baji.pgdev@gmail.com> wrote:
>
> On Tue, Jul 14, 2026 at 2:16 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>>
>>
>> I guess we don't need to name it with the prefix UUIDV7 as the offset
>> value is actually not limited to UUIDv7. How about renaming it to
>> PG_UNIX_EPOCH_OFFSET_US?
>>
>> +-- uuidv7: a large but in-range forward shift is accepted
>> +SELECT uuid_extract_timestamp(uuidv7('1000 years'::interval)) > now()
>> + '999 years'::interval;
>>
>> I've merged two patches into one and made some cosmetic changes and
>> the above suggestions. I'm going to push it, barring objections.
>
>
> Thanks for the review and the cleanup! v6 looks good to me.
>
> The rename to PG_UNIX_EPOCH_OFFSET_US makes sense, and replacing
> the 292230 years test with the in-range forward shift is a nice improvement.
>
> No objections from my side.

Thank you for reviewing the patch. Pushed.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com






view thread (23+ messages)

Message-ID: <CAD21AoBQQS0HqvCGwa-g3p5wC4MPUo-rHGKT6+MEnsY8uOMCJQ@mail.gmail.com>
Permalink:  ../CAD21AoBQQS0HqvCGwa-g3p5wC4MPUo-rHGKT6+MEnsY8uOMCJQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CAD21AoBQQS0HqvCGwa-g3p5wC4MPUo-rHGKT6+MEnsY8uOMCJQ@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: sawada.mshk@gmail.com, baji.pgdev@gmail.com, zsolt.parragi@percona.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: uuidv7 improperly accepts dates before 1970-01-01
  In-Reply-To: <CAD21AoBQQS0HqvCGwa-g3p5wC4MPUo-rHGKT6+MEnsY8uOMCJQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox