Re: [doc patch] extra_float_digits and casting from real to numeric - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: [doc patch] extra_float_digits and casting from real to numeric
Date
Msg-id 20140206085937.GA28985@msgid.credativ.de
Whole thread Raw
In response to Re: [doc patch] extra_float_digits and casting from real to numeric  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Re: Robert Haas 2014-02-05 <CA+TgmoZY4KKapTkf2PXCoQnT-jb0YSP8w2PhP_qge62NiLv5oA@mail.gmail.com>
> >>         <literal>0</literal>, the output is the same on every platform
> >>         supported by PostgreSQL.  Increasing it will produce output that
> >>         more accurately represents the stored value, but may be unportable.
> >> +       Casts to other numeric datatypes and the <literal>to_char</literal>
> >> +       function are not affected by this setting, it affects only the text
> >> +       representation.
> >>        </para>
> >>       </note>
> >>
> >
> > Anyone for that patch?
>
> Well, the new text kinda recapitulates what the existing text already
> says.  If we're going to clarify, I'd do it like this:
>
>      The <xref linkend="guc-extra-float-digits"> setting controls the
>       number of extra significant digits included when a floating point
>       value is converted to text for output.  It does not affect the results
>       when a floating point number is converted to some other data type
>       or formatted using <literal>to_char</literal>.
>
> But frankly I'm inclined to just leave it alone.  It says that it
> affects what happens when the value "is converted to text for output".
>  That's specific and accurate.  Granted, someone could misunderstand,
> but that's true of almost anything we might write, and being too
> long-winded has costs of its own.

Yes, the original text is correct. The point is that the original text
doesn't really make the reader (who might think the numbers he's
seeing on the screen will also be used for computation/inserts) aware
that he's looking at something very different from what will actually
be used internally. I'm sure we were not the only one to stumble over
that problem, and I even knew what extra_float_digits is for, yet I
didn't connect the dots in the beginning.

Including some explicit heads-up sentence in there solves that
problem, either your version, or mine.

Mit freundlichen Grüßen,
Christoph Berg
--
Tel.: +49 (0)21 61 / 46 43-187
credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209
Hohenzollernstr. 133, 41061 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication
Next
From: Jeremy Harris
Date:
Subject: Re: Minor performance improvement in transition to external sort