Re: BUG #18951: Precision loss in inner join while using SUM aggregate function - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18951: Precision loss in inner join while using SUM aggregate function
Date
Msg-id 183009.1749397821@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18951: Precision loss in inner join while using SUM aggregate function  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> -- judgement: s1 = s2 + s3, However, s2 is not correctly computed

[ shrug... ] If you are expecting exact results, don't use
floating-point arithmetic (ie, use "numeric" not "double precision").
This example, which will result in adding values of enormously
different magnitudes in various orders, is tailor-made to
exhibit roundoff error.

https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT

            regards, tom lane



pgsql-bugs by date:

Previous
From: Junwang Zhao
Date:
Subject: Re: BUG #18951: Precision loss in inner join while using SUM aggregate function
Next
From: Tom Lane
Date:
Subject: Re: tlsv1 alert iso-8859-1 ca error on cert authentication