pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-hackers list <pgsql-hackers@lists.postgresql.org>
Subject: Re: Have I found an interval arithmetic bug?
Date: Wed, 28 Jul 2021 13:47:33 -0400
Message-ID: <595327.1627494453@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZXQkjiFgijoTvezJLQLPMHeQevpw7+FYf-EQ4cpz3v1A@mail.gmail.com>
References: <BDAE4B56-3337-45A2-AC8A-30593849D6C0@yugabyte.com>
	<20210402180549.GF9270@momjian.us>
	<CALNJ-vRJUo62KNrQsiSsNAuPSBYpOXk8SPLh6r5jwHVzYai=HA@mail.gmail.com>
	<20210402234943.GB29126@momjian.us>
	<95D98B9E-CD54-4FAC-9574-D950E9741CAC@yugabyte.com>
	<20210403010229.GE29126@momjian.us>
	<20210727193614.GE19774@momjian.us>
	<456756.1627416114@sss.pgh.pa.us>
	<CA+Tgmob-eV1wUY5zVpzPVFo1-jtuTsn1BJ5OMKQp4bc1a7=Ohw@mail.gmail.com>
	<588727.1627487554@sss.pgh.pa.us>
	<CA+TgmoZbuxd=+oLHAB5iZVA3yGkyfkJXhqS4E1vGe9QcK3BE3A@mail.gmail.com>
	<593114.1627491944@sss.pgh.pa.us>
	<CA+TgmoZXQkjiFgijoTvezJLQLPMHeQevpw7+FYf-EQ4cpz3v1A@mail.gmail.com>

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





view thread (99+ messages)  latest in thread

Message-ID: <595327.1627494453@sss.pgh.pa.us>
Permalink:  ../595327.1627494453@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/595327.1627494453@sss.pgh.pa.us

 · 

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, robertmhaas@gmail.com, bruce@momjian.us, bryn@yugabyte.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Have I found an interval arithmetic bug?
  In-Reply-To: <595327.1627494453@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