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 1m71lq-000368-N5 for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jul 2021 20:27:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m71lp-0002vx-LO for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Jul 2021 20:27:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m71lp-0002vp-E0 for pgsql-hackers@lists.postgresql.org; Fri, 23 Jul 2021 20:27:45 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m71ll-0005Pu-77 for pgsql-hackers@postgresql.org; Fri, 23 Jul 2021 20:27:44 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1m71li-0006gT-4L; Fri, 23 Jul 2021 16:27:38 -0400 Date: Fri, 23 Jul 2021 16:27:38 -0400 From: Bruce Momjian To: Bryn Llewellyn Cc: Zhihong Yu , Tom Lane PostgreSQL , Dean Rasheed , Daniel Gustafsson , Justin Pryzby , Isaac Morland , John W Higgins , PostgreSQL-development Subject: Re: Have I found an interval arithmetic bug? Message-ID: <20210723202738.GC8025@momjian.us> References: <677937.1626861539@sss.pgh.pa.us> <711398.1626888589@sss.pgh.pa.us> <20210722000713.GA19630@momjian.us> <654FEA5F-79CF-414A-9801-F1482EEBCD88@yugabyte.com> <20210722014331.GB19630@momjian.us> <20210723150551.GA8025@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jul 23, 2021 at 10:55:11AM -0700, Bryn Llewellyn wrote: > SELECT > '1.2345 months 1.2345 days 1.2345 seconds'::interval = > '1 month 1 day 1 second'::interval*1.2345; > > In 13.3, the result is TRUE. (I know that this doesn’t guarantee that the > internal representations of the two compared interval values are the same. But > it’s a necessary condition for the outcome that I’m referring to and serves to > indecate the pont I’m making. A more careful test can be made. So you are saying fractional unit output should match multiplication output? It doesn't now for all units: SELECT interval '1.3443 years'; interval --------------- 1 year 4 mons SELECT interval '1 years' * 1.3443; ?column? --------------------------------- 1 year 4 mons 3 days 22:45:07.2 It is true this patch is further reducing that matching. Do people think I should make them match as part of this patch? -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.