Re: Zero-padding and zero-masking fixes for to_char(float) - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: Zero-padding and zero-masking fixes for to_char(float)
Date
Msg-id 87r3se7403.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: Zero-padding and zero-masking fixes for to_char(float)  (Jeff Anton <antonpgsql@hesiod.org>)
List pgsql-hackers
>>>>> "Jeff" == Jeff Anton <antonpgsql@hesiod.org> writes:
Jeff> Postgresql seems to be using the first interpretation andJeff> reporting fewer digits.  I've noticed this with
pg_dump. That aJeff> dump and restore of floating point values does not produce theJeff> same floating point values.
Tome, that is inexcusable.  UsingJeff> the -Fc format, real values are preserved.  I have a largeJeff> database of
securityprices.  I want accuracy above all.
 

-Fc doesn't do anything different with floats than text dumps do.

pg_dump (in all modes) uses the extra_float_digits setting to try and
get a value that restores exactly. There have been issues with this in
the past (the limit of extra_float_digits had to be raised from 2 to 3,
iirc), but if it's happening now then that should probably be considered
a bug.

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: Jeff Anton
Date:
Subject: Re: Zero-padding and zero-masking fixes for to_char(float)
Next
From: Bruce Momjian
Date:
Subject: Re: Zero-padding and zero-masking fixes for to_char(float)