Re: [HACKERS] Floating point error

From: Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "Daniel Farina *EXTERN*" <daniel(at)heroku(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Tom Duffey *EXTERN*" <tduffey(at)trillitech(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Floating point error
Date: 2013-03-05 16:37:58
Message-ID: CAOtHd0D7XQVGudiYYNRd-4U2TzVQzcCRndKeUar6TsH-mJki=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Mar 5, 2013 at 12:03 AM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> wrote:
> I don't think that it is about looking nice.
> C doesn't promise you more than FLT_DIG or DBL_DIG digits of
> precision, so PostgreSQL cannot either.
>
> If you allow more, that would mean that if you store the same
> number on different platforms and query it, it might come out
> differently. Among other things, that would be a problem for
> the regression tests.

Thank you: I think this is what I was missing, and what wasn't clear
from the proposed doc patch. But then how can pg_dump assume that it's
always safe to set extra_float_digits = 3? Why the discrepancy between
default behavior and what pg_dump gets? It can't know whether the dump
is to be restored into the same system or a different one (and AFAICT,
there's not even an option to tweak extra_float_digits there).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guy Rouillier 2013-03-05 16:47:27 Re: 9.2 timestamp function syntax error
Previous Message James Cloos 2013-03-05 16:36:29 Re: [HACKERS] Floating point error

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-03-05 16:49:51 Re: Support for REINDEX CONCURRENTLY
Previous Message James Cloos 2013-03-05 16:36:29 Re: [HACKERS] Floating point error