Skip site navigation (1) Skip section navigation (2)

Floating point problem?

From: Chito Lapena <chito(at)webims(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Floating point problem?
Date: 2006-06-26 15:44:06
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
This has become more of a prominent problem as we've added more data 
integrity checks in our code... We are getting errors like the following 
from our debug output:

EMP ID: 3 Ledger balance mismatch - record: 116.1 Ledger: 116.1 diff: 

record: float4
ledger: float4

diff = ledger - record

This is causing a large number of our commit transactions to abort 
because we are basically checking the balance record of a ledger (in one 
table) VS the last balance in that ledger (in another table) and it is 
being flagged as not equal with the infinitesimal difference. We have 
tried typecasting and that is not working. We are going to kludge this 
to work by replacing the 'is equal to' operator with a subtract 
operation compared with a small number. Needless to say, we would rather 
not do it this way.

These are 2 servers that are having the same problem

Linux 2.6.12-1.1381_FC3smp #1 SMP Fri Oct 21 04:03:26 EDT 
2005 i686 i686 i386 GNU/Linux

Linux 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 
i686 i686 i386 GNU/Linux

thanks for your attention to this

-Chito Lapena


pgsql-bugs by date

Next:From: Alvaro HerreraDate: 2006-06-26 19:44:17
Subject: Re: BUG #2497: bug initdb
Previous:From: bruno CorbinDate: 2006-06-26 07:04:59
Subject: BUG #2497: bug initdb

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group