Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pedro Gimeno <pgsql-004(at)personal(dot)formauri(dot)es>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, rschaaf(at)commoninf(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version
Date: 2015-03-25 19:57:34
Message-ID: 22366.1427313454@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Pedro Gimeno <pgsql-004(at)personal(dot)formauri(dot)es> writes:
> Tom Lane wrote, On 2015-03-25 18:57:
>> Hmm ... I'm thinking we probably should explicitly check for inf and NaN,
>> no?

> I agree about NaN; it worked but mostly by accident. The big number
> detection catches infinity unambiguously. Added to a comment in the
> attached (plus corresponding tests).

I fooled around with this some more for clarity and committed it.
Thanks for your work!

BTW, if memory serves we also have a pretty lazy rounding implementation
for the numeric datatype. I wonder if now would be a good time to upgrade
that to be round-to-nearest-even as well.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Duncan Smith 2015-03-25 22:33:38 Wire protocol encoding for 'inet' type is defined unreliably
Previous Message Pedro Gimeno 2015-03-25 18:27:35 Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version