Re: [doc patch] extra_float_digits and casting from real to numeric

From: Christoph Berg <christoph(dot)berg(at)credativ(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [doc patch] extra_float_digits and casting from real to numeric
Date: 2014-02-06 08:59:37
Message-ID: 20140206085937.GA28985@msgid.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Robert Haas 2014-02-05 <CA+TgmoZY4KKapTkf2PXCoQnT-jb0YSP8w2PhP_qge62NiLv5oA(at)mail(dot)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeremy Harris 2014-02-06 09:22:42 Re: Minor performance improvement in transition to external sort
Previous Message Andres Freund 2014-02-06 08:58:59 Re: Patch: show xid and xmin in pg_stat_activity and pg_stat_replication