← Back to team overview

anewt-developers team mailing list archive

[Bug 370360] Re: PostgreSQL result: numeric column type

 

> The 'numeric' column type in a PostgreSQL result is now converted to
> float. However, 'numeric' doesn't necessarily mean it is a floating
> point value. Doing a SUM() over some BIGINT column also reports a
> 'numeric' type, and by converting it to a float I've lost precision
> information.

I don't see how one could possibly lose precision in this case. A
mathemathical property of integer numbers is that addition, subtraction
and multiplication (but not division!) of two integers will always
result in an integer. I suspect PostgreSQL somehow detects/assumes that
summing over BIGINT may cause numerical overflow, and converts the
numbers to floats (which can keep higher numbers).

It could well be that I'm overlooking something here, though. If so,
please tell me how (and why) you lost numerical precision in the case
you described.

** Changed in: anewt
       Status: New => Triaged

-- 
PostgreSQL result: numeric column type
https://bugs.launchpad.net/bugs/370360
You received this bug notification because you are a member of Anewt
developers, which is subscribed to Anewt.



References