Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version
Date
Msg-id 8192.1427306273@sss.pgh.pa.us
Whole thread Raw
In response to BUG #12885: The result of casting a double to an integer depends on the database version  (rschaaf@commoninf.com)
Responses Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version  (Pedro Gimeno <pgsql-004@personal.formauri.es>)
List pgsql-bugs
Pedro Gimeno <pgsql-004@personal.formauri.es> writes:
> The previous version left out a corner case. Attached is a function and
> test suite to deal with it.

Hmm ... I'm thinking we probably should explicitly check for inf and NaN,
no?

    if (isnan(x) || isinf(x))
       return x;

It's possible the given coding would return this result anyway by
accident, but that seems rather fragile.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: BUG #12896: Unable to export data from Postgresql database
Next
From: Tom Lane
Date:
Subject: Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version