Re: Ryu floating point output patch

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Donald Dong <xdong@csumb.edu>
Cc: Andres Freund <andres@anarazel.de>, Andrew Gierth <andrew@tao11.riddles.org.uk>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Chapman Flack <chap@anastigmatix.net>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-01-14T03:35:09Z
Lists: pgsql-hackers
On Sunday, January 13, 2019, Donald Dong <xdong@csumb.edu> wrote:
>
> Also I wonder why do we need to make this change?
> -int                    extra_float_digits = 0; /* Added to DBL_DIG or
> FLT_DIG */
> +int                    extra_float_digits = 1; /* Added to DBL_DIG or
> FLT_DIG */
>

From the original post:

“This version of the patch continues to use extra_float_digits to select
whether Ryu output is used - but I've also changed the default, so that
Ryu is used unless you explicitly set extra_float_digits to 0 or less.”

David J.

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.