Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rT39K-00049F-04 for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jan 2024 17:04:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rT39G-001Yhw-Sp for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jan 2024 17:04:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rT39F-001Ygu-NA for pgsql-hackers@lists.postgresql.org; Thu, 25 Jan 2024 17:04:18 +0000 Received: from sonic304-24.consmr.mail.gq1.yahoo.com ([98.137.68.205]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rT39C-003gLT-Nv for pgsql-hackers@postgresql.org; Thu, 25 Jan 2024 17:04:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048; t=1706202250; bh=F5g9gDx/CcODTRPjQqLxnEQ00NUGtud2rSwpLdWTblI=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=nN8NRqt3FIegkBe3Ojg5P+UO40ZlFdrG8vBVo56lJAbquCDEikaJS1R+rVkHBaHBupN4yelt+M+ycApM4rCTXNpB7RrSwROiPwNWhKP9o4v6ovNfKOAwvPYZxEQJPWY5eTPfdJnjJOu9ODIP+zlMzFXOHArHQGPoYkj3FzwBLIrtvQo5gBCackFwdReKxlC+vmhCN37YcEHePKcjm3bhv84OsrowNl2GJOqrfDrggWxo6xR4Y0HMH8CXHW8YfY+ngJBOz/iL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ht6KUkBTV0Z2ZWq1w52qjxJKVjCpDe 44KQJfn9Xg3bSX_P5gpZquVnoY1rtb26Xtq_Twu_ysbFLp2K1a8tT.eRv4O1a295AKjHL22TCCRo AQZh8AeEv.Njobw3Jp5uPBQeDwf7IM19Z_ixTcOqYUBb7VtfQCsj1VbLK78tLeN0zKPP2e.eBnN6 l66mgvfLyudQLg3CZJfTCoLm70DEQuZg2AVs08wu5xkbnry8sBhXBVQneOrM6AfV29ElyWEMuZ2T 6MTSDKxHc3rqruHXqqVvZdLsH4cOO4AO6iQHOJIXPlvlqNnb6bDxKGFaWI0KmDuCmcNephVsIpD7 KSFSqnrQTWor7fTFQwPI8G4v88ZgskFnYNV7DuIClgs9QApC57GA17jiJCL383nGRQU206xa5qip OdXfl41_yhtnWs7iMpaeKWIEu4UCuLl1j_aeVIK1jeV80KitZrAykSZrbW8j8FoJCQ160tzpl9Uh MPesM9dMTlRJy9FbYQjRYRx6iiLY4EwiTFuvm82OHOjlmYuCE6rmU0pnfj0rr0IUgHsV1nUwnNkh y2ozPam6zW_rEOYn4vvV.TLSYz6GIpzoPdcEBxdNW.xMa1kdu_I77tkOqmHhCiC0e2QGMj6v2VXq oy06www6DDeBOikBtFtynSuHC5xmikvADtaODAyrGQHdd5YbzWNEWNLKIhEMYQlM24Fo2kLrpI_h QnrZYeDOgWFcW6hIrjW08TGPtOb.XvpQO2wCAMYkMN6eaYoFw7yafCATvkjw9PWY6GvMcgOfJlY0 8gLxIdd45wULG X-Sonic-MF: X-Sonic-ID: eafed303-991c-4686-a4dd-4adf3951434a Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Thu, 25 Jan 2024 17:04:10 +0000 Date: Thu, 25 Jan 2024 17:04:05 +0000 (UTC) From: Sergey Prokhorenko To: pgsql-hackers mailing list , Aleksander Alekseev Cc: "Andrey M. Borodin" , =?UTF-8?Q?Przemys=C5=82aw_Sztoch?= , Nikolay Samokhvalov , "David G. Johnston" , Jelte Fennema-Nio , Nick Babadzhanian , Mat Arye , Peter Eisentraut , Tom Lane , Daniel Gustafsson , Matthias van de Meent , Nikolay Samokhvalov , "Kyzer Davis (kydavis)" , Andres Freund , "brad@peabody.io" , Kirk Wolak Message-ID: <1014147035.642629.1706202245918@mail.yahoo.com> In-Reply-To: References: <1003561938.6914482.1704452267331@mail.yahoo.com> <80E8F728-FC9C-461E-9B61-332E3AAEC066@yandex-team.ru> <67eb8a02-f35c-af10-1615-afae0f9f7548@sztoch.pl> <8A52AED1-2CA6-403C-8B5B-D24EA8D58616@yandex-team.ru> <9CE1E513-B11A-4C59-980E-D61EC56716E7@yandex-team.ru> <0A0D7507-C434-46AC-BCC4-1166C5A2742A@yandex-team.ru> <1459150585.359059.1706132985954@mail.yahoo.com> <00B784AB-5B52-4CC7-8A0D-B1C0C53B52DC@yandex-team.ru> Subject: Re: UUID v7 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_642628_1369770526.1706202245917" X-Mailer: WebService/1.1.22046 YMailNorrin Content-Length: 7147 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_642628_1369770526.1706202245917 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Aleksander, In this case=C2=A0the documentation must state that the functions uuid_extr= act_time() and uuidv7(T) are against the=C2=A0RFC requirements, and that de= velopers may use these functions with caution at their own risk, and these= =C2=A0functions are not recommended for production environment. The function=C2=A0uuidv7(T) is not better than=C2=A0uuid_extract_time().=C2= =A0Careless developers may well pass any business date into this function: = document date, registration date, payment date, reporting date, start date = of the current month, data download date, and even a constant. This would b= e a profanation of UUIDv7 with very negative consequences. Sergey Prokhorenkosergeyprokhorenko@yahoo.com.au=20 On Thursday, 25 January 2024 at 03:06:50 pm GMT+3, Aleksander Alekseev = wrote: =20 =20 Hi, > Postgres always was a bit hackerish, allowing slightly more then is safe.= I.e. you can define immutable function that is not really immutable, turn = off autovacuum or fsync. Why bother with safety guards here? > My opinion is that we should have this function to extract timestamp. Eve= n if it can return strange values for imprecise RFC implementation. Completely agree. Users that don't like or don't need it can pretend there are no uuid_extract_time() and uuidv7(T) in Postgres. If we don't provide them however, users that need them will end up writing their own probably buggy and not compatible implementations. That would be much worse. > So +1 for erroring when you provide a timestamp outside of that range > (either too far in the past or too far in the future). > > OK, it seems like we have some consensus on ERRORing.. > > Do we have any other open items? Does v13 address all open items? Maybe l= et=E2=80=99s compose better error message? > > +1 for erroring when ts is outside range. > > v13 looks good for me. I think we have reached a optimal compromise. Andrey, many thanks for the updated patch. LGTM, cfbot is happy and I don't think we have any open items left. So changing CF entry status back to RfC. --=20 Best regards, Aleksander Alekseev =20 ------=_Part_642628_1369770526.1706202245917 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Aleksander,

In this case the documentation must state that the= functions uuid_extract_time() and uuidv7(T) are against the&n= bsp;RFC requirements, and that developers may use these functions with caut= ion at their own risk, and these functions are not recommended for production environment.

The functi= on uuidv7(T) is not better= than uuid_extract_time().=  Careless developers may well pass any business date into this f= unction: document date, registration date, payment date, reporting date, st= art date of the current month, data download date, and even a constant. Thi= s would be a profanation of UUIDv7 with very negative consequences.<= /span>


Sergey Prokhorenko
sergeyprokhorenko@yahoo.com.au


=20
=20
On Thursday, 25 January 2024 at 03:06:50 pm GMT+3, Alek= sander Alekseev <aleksander@timescale.com> wrote:


Hi,

> Postgres always was a bit hackerish, allowing slightly more then i= s safe. I.e. you can define immutable function that is not really immutable= , turn off autovacuum or fsync. Why bother with safety guards here?
> My opinion is that we should have this function to extract = timestamp. Even if it can return strange values for imprecise RFC implement= ation.

Completely agree.

Users that don't like or don't need it can pretend = there are no
uuid_extract_time() and uuidv7(T) in Postgre= s. If we don't provide
them however, users that need them= will end up writing their own
probably buggy and not com= patible implementations. That would be much
worse.


> So +1 for erroring when you provide a timesta= mp outside of that range
> (either too far in the past= or too far in the future).
>
> O= K, it seems like we have some consensus on ERRORing..
>= ;
> Do we have any other open items? Does v13 address = all open items? Maybe let=E2=80=99s compose better error message?
>
> +1 for erroring when ts is outside ra= nge.
>
> v13 looks good for me. I= think we have reached a optimal compromise.


Andrey, many thanks for the updated patch.
<= br clear=3D"none">LGTM, cfbot is happy and I don't think we have any open i= tems left. So
changing CF entry status back to RfC.

--
Best regards,
Aleksander Alekseev

------=_Part_642628_1369770526.1706202245917--