Re: Float/Double cast to int

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Feng Tian <ftian(at)vitessedata(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Float/Double cast to int
Date: 2015-05-21 21:53:51
Message-ID: CAB7nPqQzP+phGo4A7bcEkcpY4C_tbFK-fBfk3Vapgy=boYoi3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 22, 2015 at 4:33 AM, Feng Tian <ftian(at)vitessedata(dot)com> wrote:
> Ah, thanks! I did not realize numeric comes into play. But, this is even
> more interesting -- I would expect numeric is more consistent than
> float/double when dealing with stuff like rounding.
>
> I missed the not too long ago discussion, :-) Regardless of the mechanisms
> underneath, it would be quite hard to explain this behavior to customer.
> Maybe it is time to be brave, and be compatible with reality instead of
> backward?

Here is some food for thought:
- The original thread of pgsql-bug where this has been discussed first
http://www.postgresql.org/message-id/flat/20150320194337(dot)2573(dot)72944(at)wrigleys(dot)postgresql(dot)org#20150320194337(dot)2573(dot)72944@wrigleys.postgresql.org
- Another thread to document this behavior more appropriately (patch pending)
http://www.postgresql.org/message-id/CAB7nPqRVCbvYAWL++vCfyzOUujEay21bcLbBk_Mb=+2JX7+e5A@mail.gmail.com
Regards,
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-05-21 22:26:49 Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint
Previous Message Andrew Dunstan 2015-05-21 21:25:00 Re: jsonb concatenate operator's semantics seem questionable