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 1rSur6-00GlSP-1s for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jan 2024 08:13:01 +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 1rSur5-00Dz8k-3P for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Jan 2024 08:12:59 +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 1rSur4-00Dz8c-HJ for pgsql-hackers@lists.postgresql.org; Thu, 25 Jan 2024 08:12:58 +0000 Received: from sonic317-22.consmr.mail.gq1.yahoo.com ([98.137.66.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rSuqz-003cAE-KX for pgsql-hackers@postgresql.org; Thu, 25 Jan 2024 08:12:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s2048; t=1706170369; bh=521ynLFBA2vx4RUR2NLOt8nxvY7jYGlN/4xugWunExI=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=eucYKKKVfKUICpPl/sEM1y0d+Cp3j74iS1CqtehFKTbwPp3wfUB0Eboyc+aq8oYj527cZm5X5q5f5AphFjg2aaC0Y1AxG/JZEwNDampVpwZTEVEXejj6nWF49F2DsqysDDYkixzQJh2E6GGZUc3wgMu9vmq//i8yFK0s7LkV6bZg9zxjdCj649ZqV5VPCeAhW+37rOmev9tT0VeS+EJJTnzJCSNxcyn0vJc0Q6jN5qYi2dp/IQZ4loQkH8btdXshBL1KkOA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oS14QqWQn4.5bgT96MfJ.QM5wFDvbi LacZPYY3rsKsNvHVU6m7QLcRAbJkTQq7bO1s9EstNfoGGwyZeOG_ATApflob65Nxey5rteRrHnGU GQ4Kp3MF2zN.DzPEKs_16y0Ebu1IFApZHMZGnLIdW4qyKDgdvOhjzw8x206S1PX67bzUKELsDmY6 SwRK9lyN8uQK2uT1t9shN_JTKV5dXshjEJaNF9W6nTZNxgD6gGEMp1bX5xb.fzSsDEInFdLW13qM uVM9sM6XmDiy02_QSk85NJlADTr.jYqZiOE2v.3n77nkcrMN9irJCFTyT85IgJ55otM1ZIPa_XjH o_q4uVOebRGqq8GQWxjW035x48CPYMVB66A_2NyFNZfVzn.0MpG1u6UGsU7cgPrppdwOfSBa.P6P zuOiAspfjuMCKDU9KAUipZZCcXh0czXes5nj.sL_2R6hkfb_r0vsaLULkJrTdFa3bELUhOShy5h2 P24s.BpYJGYMudLmIlZ60pq0DaOicD.KBzHMGVnGqeRjsHE8C21KUQ_JtMRRaWQI6RczW4hNgO0c N26D0MasnoBjU_27lFLhIa0mw2HxIA5b0F6OCu85rcUWYpv.LvHEspj3bmLibsoIrKEkqu3FLCLn C2KPaj8Gxf9kM3YLs3Gh7E6HexYFA6hcNr9sLoyqtcv84owFMm4AvjYyxwOx5UE4QwTFOL2o8D8E pETxeZSTTa13e8ZcMaH8MTdkN5W9T8ejQ_jnGKA9KMo4e.tiJI3PKiEejaHQs2Q1qLOmRRZvXmTA JgZal.UJgXtUleA-- X-Sonic-MF: X-Sonic-ID: 000de871-aacc-4529-bc1e-befc0f2efc6b Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Thu, 25 Jan 2024 08:12:49 +0000 Date: Thu, 25 Jan 2024 08:09:18 +0000 (UTC) From: Sergey Prokhorenko To: Nikolay Samokhvalov , "Andrey M. Borodin" Cc: "David G. Johnston" , Aleksander Alekseev , pgsql-hackers mailing list , =?UTF-8?Q?Przemys=C5=82aw_Sztoch?= , 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: <123941969.493601.1706170158988@mail.yahoo.com> In-Reply-To: <00B784AB-5B52-4CC7-8A0D-B1C0C53B52DC@yandex-team.ru> References: <3BDCCF0B-9C96-416C-87F6-071ABD7AED8B@yandex-team.ru> <3E7F8826-A275-44B6-A374-6E35B3B60AD5@yandex-team.ru> <6941A45B-C7D4-414B-A3A9-ACED172DFBD5@yandex-team.ru> <8DB43887-CA09-4845-83C0-33E8A79D0711@yandex-team.ru> <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_493600_645006664.1706170158987" X-Mailer: WebService/1.1.22046 YMailNorrin Content-Length: 6091 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_493600_645006664.1706170158987 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I am against turning the DBMS into another C++, in which they do not so muc= h design something new as fix bugs in production after a crash. As for partitioning, I already wrote to Andrey Borodin that we need a speci= al function to generate a partition id using the UUIDv7 timestamp or even s= imultaneously with the generation of the timestamp. For example, every mont= h (or so, since precision is not needed here) a new partition is created. H= ere's a good example: https://elixirforum.com/t/partitioning-postgres-table= s-by-timestamp-based-uuids/60916 But without a separate function for extracting the entire timestamp from th= e UUID! Let's solve this specific problem, and not give the developers a gr= enade with the safety removed. Many developers have already decided to stor= e the timestamp in UUIDv7, so as not to create a separate created_at field.= Then they will delete table records with the old timestamp, etc. Horrible = mistakes are simply guaranteed. Sergey Prokhorenko sergeyprokhorenko@yahoo.com.au=20 On Thursday, 25 January 2024 at 09:51:58 am GMT+3, Andrey M. Borodin wrote: =20 =20 =20 > On 25 Jan 2024, at 09:40, Nikolay Samokhvalov wrote: >=20 > From a practical point of view, these two things are extremely important = to have to support partitioning. It is better to implement limitations than= throw them away. 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 of= f 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 implementation. > On 25 Jan 2024, at 02:15, Jelte Fennema-Nio wrote: >=20 > 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 let= =E2=80=99s compose better error message? Best regards, Andrey Borodin. =20 ------=_Part_493600_645006664.1706170158987 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am against turning the DBMS into another C++, in w= hich they do not so much design something new as fix bugs in production aft= er a crash.

As for partitioning, I already wrote t= o Andrey Borodin that we need a special function to generate a partition id= using the UUIDv7 timestamp or even simultaneously with the generation of t= he timestamp. For example, every month (or so, since precision is not neede= d here) a new partition is created. Here's a good example: https://elixirfo= rum.com/t/partitioning-postgres-tables-by-timestamp-based-uuids/60916
=

But without a separate function for extracting the enti= re timestamp from the UUID! Let's solve this specific problem, and not give= the developers a grenade with the safety removed. Many developers have alr= eady decided to store the timestamp in UUIDv7, so as not to create a separa= te created_at field. Then they will delete table records with the old times= tamp, etc. Horrible mistakes are simply guaranteed.


Sergey Prokhorenko sergeyp= rokhorenko@yahoo.com.au


=20
=20
On Thursday, 25 January 2024 at 09:51:58 am GMT+3, Andr= ey M. Borodin <x4mmm@yandex-team.ru> wrote:




> On 25 Jan 2024, at 09:40, Nikolay Samokhvalov <nik@postg= res.ai> wrote:
>
> From a= practical point of view, these two things are extremely important to have = to support partitioning. It is better to implement limitations than throw t= hem away.

Postgres always was a bit ha= ckerish, allowing slightly more then is safe. I.e. you can define immutable= function that is not really immutable, turn off autovacuum or fsync. Why b= other with safety guards here?
My opinion is that we shou= ld have this function to extract timestamp. Even if it can return strange v= alues for imprecise RFC implementation.


> On 25 Jan 2024, at 02:15, Jelte Fennema-Nio <<= a shape=3D"rect" href=3D"mailto:postgres@jeltef.nl" rel=3D"nofollow" target= =3D"_blank">postgres@jeltef.nl> wrote:
>
> So +1 for erroring when you provide a timestamp outside o= f 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 it= ems? Maybe let=E2=80=99s compose better error message?

Best regards, Andrey Borodin.
------=_Part_493600_645006664.1706170158987--