From: Bruce Momjian <bruce@momjian.us>
To: Bryn Llewellyn <bryn@yugabyte.com>
Cc: Tom Lane PostgreSQL <tgl@sss.pgh.pa.us>
Cc: Zhihong Yu <zyu@yugabyte.com>
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: Mon, 12 Apr 2021 20:25:58 -0400
Message-ID: <20210413002558.GC4231@momjian.us> (raw)
In-Reply-To: <45B3B182-960F-4588-8977-623A599C7EFA@yugabyte.com>
References: <20210408172444.GC6909@momjian.us>
<CALNJ-vR9s8zjGkUrxqLbK5GMS8Rn-o=dxb56gNSaWCHUKQZAvQ@mail.gmail.com>
<CALNJ-vQE-W9K8b_XicbeR6CEkzUsA=CqarkwTLjudYTBpH90uw@mail.gmail.com>
<CALNJ-vQkNfeM--i_L9XSpXsP_sj=UYFnAtF+u2ZhGUSe0PW6Cw@mail.gmail.com>
<20210412161842.GA22319@momjian.us>
<8707105F-C45D-4ACB-8F71-51CE5BED58A5@yugabyte.com>
<20210412232237.GA4231@momjian.us>
<3135041.1618270701@sss.pgh.pa.us>
<20210413000027.GB4231@momjian.us>
<45B3B182-960F-4588-8977-623A599C7EFA@yugabyte.com>
On Mon, Apr 12, 2021 at 05:20:43PM -0700, Bryn Llewellyn wrote:
> I’d argue that the fact that this:
>
> ('0.3 months'::interval) + ('0.7 months'::interval)
>
> Is reported as '30 days' and not '1 month' is yet another
> bug—precisely because of what I said in my previous email (sorry
> that I forked the thread) where I referred to the fact that, in the
> right test, adding 1 month gets a different answer than adding 30
> days.
Flowing _up_ is what these functions do:
\df *justify*
List of functions
Schema | Name | Result data type | Argument data types | Type
------------+------------------+------------------+---------------------+------
pg_catalog | justify_days | interval | interval | func
pg_catalog | justify_hours | interval | interval | func
pg_catalog | justify_interval | interval | interval | func
> Yet another convincing reason to get rid of this flow down
> business altogether.
We can certainly get rid of all downflow, which in the current patch is
only when fractional internal units are specified.
> If some application wants to model flow-down, then it can do so with
> trivial programming and full control over its own definition of the
> rules.
--
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: bruce@momjian.us, bryn@yugabyte.com, tgl@sss.pgh.pa.us, zyu@yugabyte.com, pryzby@telsasoft.com, isaac.morland@gmail.com, wishdev@gmail.com
Subject: Re: Have I found an interval arithmetic bug?
In-Reply-To: <20210413002558.GC4231@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