Re: Have I found an interval arithmetic bug?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Have I found an interval arithmetic bug?
Дата
Msg-id 20210403022126.GG29126@momjian.us
обсуждение исходный текст
Ответ на Re: Have I found an interval arithmetic bug?  (Zhihong Yu <zyu@yugabyte.com>)
Ответы Re: Have I found an interval arithmetic bug?
Re: Have I found an interval arithmetic bug?
Список pgsql-hackers
On Fri, Apr  2, 2021 at 07:06:08PM -0700, Zhihong Yu wrote:
> Hi,
> The mix of interval and comparison with float is not easy to interpret. See the
> following (I got 0.0833 since the result for interval '0.3 years' + interval
> '0.4 years' - ... query was 1 month and 1/12 ~= 0.0833).
> 
> yugabyte=# select 0.3 * '1 year'::interval + 0.4 * '1 year'::interval - 0.7 *
> '1 year'::interval = '0.0833 year'::interval;
>  ?column?
> ----------
>  f
> 
> As long as Bruce's patch makes improvements over the current behavior, I think
> that's fine.

I wish I could figure out how to improve it any futher.  What is odd is
that I have never seen this reported as a problem before.  I plan to
apply this early next week for PG 14.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Have I found an interval arithmetic bug?
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [PATCH] Implement motd for PostgreSQL