Re: Have I found an interval arithmetic bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Zhihong Yu <zyu(at)yugabyte(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Bryn Llewellyn <bryn(at)yugabyte(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Isaac Morland <isaac(dot)morland(at)gmail(dot)com>, John W Higgins <wishdev(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Have I found an interval arithmetic bug?
Date: 2021-07-21 09:58:59
Message-ID: 677937.1626861539@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> Hmm, looking at this whole thread, I have to say that I prefer the old
> behaviour of spilling down to lower units.

> For example, with this patch:

> SELECT '0.5 weeks'::interval;
> interval
> ----------
> 4 days

> which I don't think is really an improvement. My expectation is that
> half a week is 3.5 days, and I prefer what it used to return, namely
> '3 days 12:00:00'.

Yeah, that is clearly a significant dis-improvement.

In general, considering that (most of?) the existing behavior has stood
for decades, I think we need to tread VERY carefully about changing it.
I don't want to see this patch changing any case that is not indisputably
broken.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message WR 2021-07-21 10:49:06 Obsolete or dead serverconnections after reboot
Previous Message Dean Rasheed 2021-07-21 08:23:18 Re: Have I found an interval arithmetic bug?

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-07-21 10:09:54 Re: [PATCH] Use optimized single-datum tuplesort in ExecSort
Previous Message Rahila Syed 2021-07-21 09:44:23 Re: Added schema level support for publication.