Re: Bug / feature request for floating point to string conversion - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug / feature request for floating point to string conversion
Date
Msg-id 3028.1349893605@sss.pgh.pa.us
Whole thread Raw
In response to Bug / feature request for floating point to string conversion  (Daniel Frey <d.frey@gmx.de>)
Responses Re: Bug / feature request for floating point to string conversion  (Daniel Frey <d.frey@gmx.de>)
List pgsql-hackers
Daniel Frey <d.frey@gmx.de> writes:
>   INSERT INTO dummy VALUES ( '0X1P-1022' );

> this value itself is the problem. If I use pg_dump / pg_restore, the restore fails with:

>   COPY failed for table "dummy": ERROR:  "2.22507385850720138e-308" is out of range for type double precision

> This behavior might depend on the system's implementation of strtod(), I'm using Ubuntu 12.04.

That is definitely a bug in strtod, which you should report.  If it
doesn't accept a value that sprintf output, something is broken at the
libc level.

> While the problem occurs when importing the data back, the root (IMHO) is, that I can not request floating point
values(datatypes REAL and DOUBLE PRECISION) to be returned as strings with the hexadecimal notation (which would easily
preserveall bits).
 

That's not much of a solution from our standpoint, because it assumes
that every platform has such a feature (and that they all agree on what
the hex notation means).
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Minor document updates
Next
From: Boszormenyi Zoltan
Date:
Subject: Re: [PATCH] Make pg_basebackup configure and start standby [Review]