Re: Have I found an interval arithmetic bug?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Have I found an interval arithmetic bug?
Дата
Msg-id 20210413002558.GC4231@momjian.us
обсуждение исходный текст
Ответ на Re: Have I found an interval arithmetic bug?  (Bryn Llewellyn <bryn@yugabyte.com>)
Ответы Re: Have I found an interval arithmetic bug?  (Bryn Llewellyn <bryn@yugabyte.com>)
Список pgsql-hackers
On Mon, Apr 12, 2021 at 05:20:43PM -0700, Bryn Llewellyn wrote:
> I’d argue that the fact that this:
>
> ('0.3 months'::interval) + ('0.7 months'::interval)
>
> Is reported as '30 days' and not '1 month' is yet another
> bug—precisely because of what I said in my previous email (sorry
> that I forked the thread) where I referred to the fact that, in the
> right test, adding 1 month gets a different answer than adding 30
> days. 

Flowing _up_ is what these functions do:

    \df *justify*
                                   List of functions
       Schema   |       Name       | Result data type | Argument data types | Type
    ------------+------------------+------------------+---------------------+------
     pg_catalog | justify_days     | interval         | interval            | func
     pg_catalog | justify_hours    | interval         | interval            | func
     pg_catalog | justify_interval | interval         | interval            | func

> Yet another convincing reason to get rid of this flow down
> business altogether.

We can certainly get rid of all downflow, which in the current patch is
only when fractional internal units are specified.

> If some application wants to model flow-down, then it can do so with
> trivial programming and full control over its own definition of the
> rules.

-- 
  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 по дате отправления:

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Re: Have I found an interval arithmetic bug?
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: wal stats questions