Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfSth-0002eX-Um for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Mar 2023 21:55:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pfStg-0006wZ-RY for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Mar 2023 21:55:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfStg-0006wQ-J9 for pgsql-bugs@lists.postgresql.org; Thu, 23 Mar 2023 21:55:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfStZ-0000tg-Gp for pgsql-bugs@lists.postgresql.org; Thu, 23 Mar 2023 21:55:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 32NLso322053301; Thu, 23 Mar 2023 17:54:50 -0400 From: Tom Lane To: Daniel Gustafsson cc: eugeny@zhuzhnev.com, pgsql-bugs , Peter Eisentraut Subject: Re: BUG #17866: behavior does not match documentation In-reply-to: References: <17866-18eb70095b1594e2@postgresql.org> <1944674.1679596295@sss.pgh.pa.us> Comments: In-reply-to Daniel Gustafsson message dated "Thu, 23 Mar 2023 22:25:49 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2053299.1679608490.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 23 Mar 2023 17:54:50 -0400 Message-ID: <2053300.1679608490@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: > On 23 Mar 2023, at 19:31, Tom Lane wrote: >> I wonder if we should rethink that and have these operations strip >> insignificant trailing zeroes. > Any app relying on insignificant trailing zeroes seems broken, but the i= nverse > can be argued as well. It's however quite easy to argue for the strippe= d > output being more readable though. It's more readable for sure, and it duplicates what you got in pre-v14 versions, at least textually. I'm not sure I'd propose back-patching this, but it feels like a good idea for HEAD. The argument for the current behavior probably goes like "we're exposing the actual precision of the value". But I don't believe that we are; we're exposing the maximum possible precision. We have no way to know how precise the original timestamp or interval input was. So I don't think there's much basis for claiming that the result is good to six fractional digits. regards, tom lane