Re: Ryu floating point output patch

Andrew Gierth <andrew@tao11.riddles.org.uk>

From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org, "David G. Johnston" <david.g.johnston@gmail.com>, Donald Dong <xdong@csumb.edu>, Andres Freund <andres@anarazel.de>, Robert Haas <robertmhaas@gmail.com>, Chapman Flack <chap@anastigmatix.net>
Date: 2019-02-17T23:42:08Z
Lists: pgsql-hackers
>>>>> "Andrew" == Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:

 Tom> I think we have to document it, but it can be fairly terse perhaps.

 Tom> Use the specified value of extra_float_digits when dumping
 Tom> floating-point data, rather than pg_dump's default.

 Tom> I don't think we need to go into detail about when/why you might
 Tom> want to use it; I can see people thinking of their own reasons.
 
 >> It should probably at least say that (a) the default is to dump with the
 >> maximum available precision, and at least hint at (b) that ordinary use
 >> doesn't require the option. We shouldn't mislead people into thinking
 >> they need it when they don't.

 Andrew> Would you like to reformulate this, then?

How about:

    Use the specified value of extra_float_digits when dumping
    floating-point data, instead of the maximum available precision.
    Routine dumps made for backup purposes should not use this option.

-- 
Andrew (irc:RhodiumToad)


Commits

  1. Provide an extra-float-digits setting for pg_dump / pg_dumpall

  2. Change floating-point output format for improved performance.

  3. Use strtof() and not strtod() for float4 input.