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 1lVzGz-0006Tm-Rm for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Apr 2021 16:18:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lVzGy-00066M-Ou for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Apr 2021 16:18:48 +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 1lVzGy-00066F-I2 for pgsql-hackers@lists.postgresql.org; Mon, 12 Apr 2021 16:18:48 +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 1lVzGv-0003UI-P1 for pgsql-hackers@postgresql.org; Mon, 12 Apr 2021 16:18:47 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1lVzGs-0006hv-8b; Mon, 12 Apr 2021 12:18:42 -0400 Date: Mon, 12 Apr 2021 12:18:42 -0400 From: Bruce Momjian To: Zhihong Yu Cc: Justin Pryzby , Bryn Llewellyn , Isaac Morland , John W Higgins , PostgreSQL-development , Tom Lane Subject: Re: Have I found an interval arithmetic bug? Message-ID: <20210412161842.GA22319@momjian.us> References: <20210403022126.GG29126@momjian.us> <20210405163310.GP6592@telsasoft.com> <20210405180158.GB12179@momjian.us> <20210408172444.GC6909@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 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 Sun, Apr 11, 2021 at 07:33:34PM -0700, Zhihong Yu wrote: > Among previous examples given by Bryn, the following produces correct result > based on Bruce's patch. > > # select interval '-1.7 years 29.4 months'; >     interval > ---------------- >  9 mons 12 days Yes, that changed is caused by the rounding fixes, and not by the unit pushdown adjustments. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.