Re: Have I found an interval arithmetic bug? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Have I found an interval arithmetic bug?
Date
Msg-id 595327.1627494453@sss.pgh.pa.us
Whole thread Raw
In response to Re: Have I found an interval arithmetic bug?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Jul 28, 2021 at 1:05 PM Tom Lane <tgl@sss.pgh.pa.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



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Asynchronous and "direct" IO support for PostgreSQL.
Next
From: Andres Freund
Date:
Subject: Re: Asynchronous and "direct" IO support for PostgreSQL.