pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bryn Llewellyn <bryn@yugabyte.com>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Zhihong Yu <zyu@yugabyte.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: Wed, 21 Jul 2021 13:29:49 -0400
Message-ID: <711398.1626888589@sss.pgh.pa.us> (raw )
In-Reply-To: <CEA45CB6-7C0B-4960-9913-BD009DD04533@yugabyte.com >
References: <20210508024204.GB27048@momjian.us >
<CALNJ-vQLukGOX5HKa7Z5tKYfNOyB6u0dU2+SuRFXExoJ_7m8QA@mail.gmail.com >
<076E1871-8446-405C-9561-29FA03F46A4A@yesql.se >
<20210630163516.GA3304@momjian.us >
<CALNJ-vTD709opMzOyfT=KVtXaAvLmpqPGGEqqqXMSZwF8aQH1A@mail.gmail.com >
<CALNJ-vQfTHNbH3VCeg3ChT42y1swnWtV-6iztthO8QfOE8wdwg@mail.gmail.com >
<20210720041419.GA5882@momjian.us >
<CALNJ-vSc22BFW__bUqJk0USvn8_w+fWLWJjNqH=6WSa1-OJRTQ@mail.gmail.com >
<20210720225350.GB27025@momjian.us >
<CALNJ-vQXQGPQiKt1SubT2fd4xGuvoN9UUtJyVr8JRfPxBfQHgg@mail.gmail.com >
<20210721024834.GA8395@momjian.us >
<CAEZATCVMXYR4-GEr4UXzZVdS1CLwFweO7P=vZrepcMu6VrQMUQ@mail.gmail.com >
<677937.1626861539@sss.pgh.pa.us >
<CEA45CB6-7C0B-4960-9913-BD009DD04533@yugabyte.com >
Bryn Llewellyn <bryn@yugabyte.com> writes:
> On 21-Jul-2021, at 02:58, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> In general, considering that (most of?) the existing behavior has stood
>> for decades, I think we need to tread VERY carefully about changing it.
>> I don't want to see this patch changing any case that is not indisputably
>> broken.
> It was me that started the enormous thread with the title “Have I found an interval arithmetic bug?” on 01-Apr-2021. I presented this testcase:
>> select interval '-1.7 years'; -- -1 years -8 mons
>>
>> select interval '29.4 months'; -- 2 years 5 mons 12 days
>>
>> select interval '-1.7 years 29.4 months'; -- 8 mons 12 days << wrong
>> select interval '29.4 months -1.7 years'; -- 9 mons 12 days
>>
>> select interval '-1.7 years' + interval '29.4 months'; -- 9 mons 12 days
>> select interval '29.4 months' + interval '-1.7 years'; -- 9 mons 12 days
> The consensus was that the outcome that I flagged with “wrong” does indeed have that status.
Yeah, I think it's self-evident that your last four cases should
produce the same results. Whether '9 mons 12 days' is the best
possible result is debatable --- in a perfect world, maybe we'd
produce '9 mons' exactly --- but given that the first two cases
produce what they do, that does seem self-consistent. I think
we should be setting out to fix that outlier without causing
any of the other five results to change.
regards, tom lane
view thread (99+ messages) latest in thread
Message-ID: <711398.1626888589@sss.pgh.pa.us>
Permalink: ../711398.1626888589@sss.pgh.pa.us/
Also on: postgresql.org/message-id/711398.1626888589@sss.pgh.pa.us
copy link · copy postgr.es
reply 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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, bryn@yugabyte.com, dean.a.rasheed@gmail.com, bruce@momjian.us, zyu@yugabyte.com, daniel@yesql.se, pryzby@telsasoft.com, isaac.morland@gmail.com, wishdev@gmail.com
Subject: Re: Have I found an interval arithmetic bug?
In-Reply-To: <711398.1626888589@sss.pgh.pa.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