Re: Have I found an interval arithmetic bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Bryn Llewellyn <bryn(at)yugabyte(dot)com>, pgsql-hackers list <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Have I found an interval arithmetic bug?
Date: 2021-07-28 17:47:33
Message-ID: 595327.1627494453@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Wed, Jul 28, 2021 at 1:05 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> That would clearly be a bug fix. I'm just troubled that there are
>> still behaviors that people will see as bugs.

> That's a reasonable thing to be troubled about, but the date and time
> related datatypes have so many odd and crufty behaviors that I have a
> hard time believing that there's another possible outcome.

There's surely a ton of cruft there, but I think most of it stems from
western civilization's received rules for timekeeping, which we can do
little about. But the fact that interval_in accepts '1.4 years' when
it cannot do anything very reasonable with that input is entirely
self-inflicted damage.

BTW, I don't have a problem with the "interval * float8" operator
doing equally strange things, because if you don't like what it
does you can always write your own multiplication function that
you like better. There can be only one interval_in, though,
so I don't think it should be misrepresenting the fundamental
capabilities of the datatype.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Litt 2021-07-28 19:27:36 Re: PostgreSQL reference coffee mug
Previous Message Matthias Apitz 2021-07-28 17:30:24 Re: PostgreSQL reference coffee mug

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-07-28 18:10:46 Re: Asynchronous and "direct" IO support for PostgreSQL.
Previous Message Melanie Plageman 2021-07-28 17:37:48 Re: Asynchronous and "direct" IO support for PostgreSQL.