Re: BUG #6217: to_char() gives incorrect output for very small float values - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6217: to_char() gives incorrect output for very small float values
Date
Msg-id 13033.1316548340@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #6217: to_char() gives incorrect output for very small float values  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: BUG #6217: to_char() gives incorrect output for very small float values  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: BUG #6217: to_char() gives incorrect output for very small float values  (Greg Stark <stark@mit.edu>)
List pgsql-bugs
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> If we're gonna fix it, we should just fix it, I think.  I was
>> considering taking a stab at it, but if someone else would like
>> to, that's fine too.

> I wouldn't mind doing it, but not until after the CF wraps.  On the
> other hand, isn't this is one of those compatibility functions?
> Perhaps it would best be done by someone who has familiarity with,
> and access to, a database with which we're trying to be compatible.

Chris already stated that the case gives the answer he expects in
several other DBs, so I don't seem much need for further compatibility
checking on the "don't round off prematurely" angle.  However, it would
be interesting to know what Oracle etc do with NaN and Infinity,
assuming they even support such numbers.

Currently what our code does for the format-with-EEEE case is to output
"#" in all digit positions.  It would be plausible for that to happen
in the non-EEEE cases too, but whether that's actually what happens in
other systems is something I don't know.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #6217: to_char() gives incorrect output for very small float values