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 1m9V4G-0003L2-3T for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jul 2021 16:09:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m9V4F-0006TS-0o for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jul 2021 16:08:59 +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 1m9V4E-0006TK-Pi for pgsql-hackers@lists.postgresql.org; Fri, 30 Jul 2021 16:08:58 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9V4C-0000Rb-0F for pgsql-hackers@lists.postgresql.org; Fri, 30 Jul 2021 16:08:58 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1m9V4A-0000rR-Rm; Fri, 30 Jul 2021 12:08:54 -0400 Date: Fri, 30 Jul 2021 12:08:54 -0400 From: Bruce Momjian To: Dean Rasheed Cc: John W Higgins , pgsql-hackers list Subject: Re: Have I found an interval arithmetic bug? Message-ID: <20210730160854.GA9600@momjian.us> References: <95D98B9E-CD54-4FAC-9574-D950E9741CAC@yugabyte.com> <20210403010229.GE29126@momjian.us> <20210727193614.GE19774@momjian.us> <456756.1627416114@sss.pgh.pa.us> <20210727211314.GA23040@momjian.us> <901454CE-2C0D-4C49-ADAB-A094C03B7CB1@yugabyte.com> <20210728151916.GA15440@momjian.us> <20210730160439.GZ9600@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210730160439.GZ9600@momjian.us> 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 30, 2021 at 12:04:39PM -0400, Bruce Momjian wrote: > On Wed, Jul 28, 2021 at 11:19:16AM -0400, Bruce Momjian wrote: > > On Wed, Jul 28, 2021 at 08:42:31AM +0100, Dean Rasheed wrote: > > > So it's equal even without calling justify_interval() on the result. > > > > > > FWIW, I remain of the opinion that the interval literal code should > > > just spill down to lower units in all cases, just like the > > > multiplication and division code, so that the results are consistent > > > (barring floating point rounding errors) and explainable. > > > > Here is a more minimal patch that doesn't change the spill-down units at > > all, but merely documents it, and changes the spilldown to months to > > round instead of truncate. > > Unless I hear more feedback, I plan to apply this doc patch to all > branches with the word "rounded" changed to "truncated" in the back > branches, and apply the rounded code changes to master. Now that I think of it, I will just remove the word "rounded" from the back branch docs so we are technically breaking the documented API less in PG 15. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.