Re: Ryu floating point output patch

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

From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: pgsql-hackers@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>, "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-13T17:09:03Z
Lists: pgsql-hackers
>>>>> "Andrew" == Andrew Gierth <andrew@tao11.riddles.org.uk> writes:

 Andrew> 2. How far do we need to go to support existing uses of
 Andrew>    extra_float_digits? For example, do we need a way for clients to
 Andrew>    request that they get the exact same output as previously for
 Andrew>    extra_float_digits=2 or 3, rather than just assuming that any
 Andrew>    round-trip-exact value will do?

 Andrew>   (this would likely mean adding a new GUC, rather than basing
 Andrew>   everything off extra_float_digits as the patch does now)

So it turns out, for reasons that should have been obvious in advance,
that _of course_ we need this, because otherwise there's no way to do
the cross-version upgrade regression check.

So we need something like exact_float_output='on' (default) that can be
selectively set to 'off' to restore the previous behavior of
extra_float_digits.

Thoughts?

-- 
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.