From: Bruce Momjian <bruce@momjian.us>
To: Bryn Llewellyn <bryn@yugabyte.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Tom Lane PostgreSQL <tgl@sss.pgh.pa.us>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Isaac Morland <isaac.morland@gmail.com>
Cc: John W Higgins <wishdev@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Have I found an interval arithmetic bug?
Date: Fri, 23 Jul 2021 16:27:38 -0400
Message-ID: <20210723202738.GC8025@momjian.us> (raw)
In-Reply-To: <A73D4699-C3A4-463A-8F33-6E9C40130C66@yugabyte.com>
References: <677937.1626861539@sss.pgh.pa.us>
<CEA45CB6-7C0B-4960-9913-BD009DD04533@yugabyte.com>
<711398.1626888589@sss.pgh.pa.us>
<20210722000713.GA19630@momjian.us>
<654FEA5F-79CF-414A-9801-F1482EEBCD88@yugabyte.com>
<20210722014331.GB19630@momjian.us>
<CALNJ-vSDZOp_25LHYQ4A_U=szX7EyTcSiE0c2Hd2ZZwAszRa5Q@mail.gmail.com>
<CALNJ-vQMtXJ325fjrXBXKkpN+jHQqYJssLjHeBaXNO5ENP4Odw@mail.gmail.com>
<20210723150551.GA8025@momjian.us>
<A73D4699-C3A4-463A-8F33-6E9C40130C66@yugabyte.com>
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 <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
If only the physical world exists, free will is an illusion.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: bruce@momjian.us, bryn@yugabyte.com, zyu@yugabyte.com, tgl@sss.pgh.pa.us, dean.a.rasheed@gmail.com, daniel@yesql.se, pryzby@telsasoft.com, isaac.morland@gmail.com, wishdev@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: Have I found an interval arithmetic bug?
In-Reply-To: <20210723202738.GC8025@momjian.us>
References: <677937.1626861539@sss.pgh.pa.us> <CEA45CB6-7C0B-4960-9913-BD009DD04533@yugabyte.com> <711398.1626888589@sss.pgh.pa.us> <20210722000713.GA19630@momjian.us> <654FEA5F-79CF-414A-9801-F1482EEBCD88@yugabyte.com> <20210722014331.GB19630@momjian.us> <CALNJ-vSDZOp_25LHYQ4A_U=szX7EyTcSiE0c2Hd2ZZwAszRa5Q@mail.gmail.com> <CALNJ-vQMtXJ325fjrXBXKkpN+jHQqYJssLjHeBaXNO5ENP4Odw@mail.gmail.com> <20210723150551.GA8025@momjian.us> <A73D4699-C3A4-463A-8F33-6E9C40130C66@yugabyte.com> <20210723202738.GC8025@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox