Re: Ryu floating point output patch
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>, Tom Lane <tgl@sss.pgh.pa.us>, Chapman Flack <chap@anastigmatix.net>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-01-11T18:30:15Z
Lists: pgsql-hackers
Hi, On 2019-01-11 12:55:54 -0500, Robert Haas wrote: > About as much as I can say is that if you commit this patch, and as a > result, a dump-and-restore from v11 to v12 causes a change in the bits > on disk that would not have occurred without this patch, that's very > bad. What ramifications there will be if the output changes in ways > that don't affect the bits that get written to the platter -- I don't > know. Are you trying to highlight the potential dangers of this patch, or are you seeing a concrete risk of that in the discussion? Both ryu's and the current output (as used by pg_dump, with extra_float_digits = 3) ought to be roundtrip safe. There's possibly some chance for differences in insignificant bits, but that ought to be pretty much it? The current discussion would probably change the data that's stored on disk between ryu/non-ryu for queries like CREATE TABLE AS SELECT floatcol::text::float FROM ... or CREATE TABLE AS SELECT floatcol::text FROM ... when not specifyiung extra_float_digits = 3, but the ryu case would be more precise, so that ought to be good? Greetings, Andres Freund
Commits
-
Provide an extra-float-digits setting for pg_dump / pg_dumpall
- af25bc03e17e 12.0 landed
-
Change floating-point output format for improved performance.
- 02ddd499322a 12.0 landed
-
Use strtof() and not strtod() for float4 input.
- f397e08599a3 12.0 landed