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: Mon, 26 Jul 2021 13:35:41 -0400
Message-ID: <20210726173541.GA13525@momjian.us> (raw)
In-Reply-To: <AC1B8865-F73A-450F-92AF-4B6070D7F671@yugabyte.com>
References: <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>
<AC1B8865-F73A-450F-92AF-4B6070D7F671@yugabyte.com>
On Sun, Jul 25, 2021 at 11:56:54AM -0700, Bryn Llewellyn wrote:
> As far as I’ve been able, the PG documentation doesn’t do a good job of
> defining the semantics of any of these operations. Some (like the “justify”
This is because fractional interval values are not used or asked about
often.
> functions” are sketched reasonably well. Others, like interval multiplication,
> are entirely undefined.
Yes, the “justify” functions were requested and implemented because they
met a frequently-requested need unrelated to fractional values, though
they do have spill-up uses.
> This makes discussion of simple test like the two I showed immediately above
> hard. It also makes any discussion of correctness, possible bugs, and proposed
> implementation changes very difficult.
Agreed. With fractional values an edge use-case, we are trying to find
the most useful implementation.
> As I’ve said, my conclusion is that the only safe approach is to create and use
> only “pure” interval values (where just one of the internal fields is
> non-zero). For this reason (and having seen what I decided was the impossibly
> unmemorable rules that my modeled implementation uses) I didn’t look at the
> rules for the other fields that the interval literal allows (weeks, centuries,
> millennia, and so on).
I think the current page is clear about _specifying_ fractional units,
but you are right that multiplication/division of fractional values is
not covered.
--
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: <20210726173541.GA13525@momjian.us>
References: <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> <AC1B8865-F73A-450F-92AF-4B6070D7F671@yugabyte.com> <20210726173541.GA13525@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