Re: Have I found an interval arithmetic bug?
| От | Bruce Momjian |
|---|---|
| Тема | Re: Have I found an interval arithmetic bug? |
| Дата | |
| Msg-id | 20210730195649.GF9600@momjian.us обсуждение исходный текст |
| Ответ на | Re: Have I found an interval arithmetic bug? (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Have I found an interval arithmetic bug?
|
| Список | pgsql-hackers |
On Fri, Jul 30, 2021 at 03:54:42PM -0400, Tom Lane wrote:
> Having said that, I also agree that it's not great that '1.4 years'
> is converted to '1 year 4 mons' (1.33333... years) rather than
> '1 year 5 mons' (1.41666... years). The latter seems like a clearly
> saner translation. I would really rather that we reject such input
> altogether, but if we're going to accept it, we should round not
> truncate.
My patch returns what you want:
SELECT interval '1.4 years';
interval
---------------
1 year 5 mons
--
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 по дате отправления: