Re: Have I found an interval arithmetic bug?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Bryn Llewellyn <bryn(at)yugabyte(dot)com>, Isaac Morland <isaac(dot)morland(at)gmail(dot)com>, John W Higgins <wishdev(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Have I found an interval arithmetic bug?
Date: 2021-04-12 16:18:42
Message-ID: 20210412161842.GA22319@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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 <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Brannen 2021-04-12 16:51:28 RE: Ways to "serialize" result set for later use?
Previous Message felix.quintgz 2021-04-12 14:53:18 Re: The Amazon CloudFront distribution is configured to block access from your country.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-04-12 16:19:48 Re: PANIC: wrong buffer passed to visibilitymap_clear
Previous Message Pavel Stehule 2021-04-12 16:11:22 Re: Contribution to PostgreSQL - please give an advice