-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INSERT/UPDATE with double floats lost precision #355
Comments
Can you check and see if you are seeing the same strange behavior I am using the following code (based on your example).
The only difference between t1-xxx and t2-xxx is that in t2-xxx the first insertion in each t2-xxx function is not a parameterized query. Now if I use the t1-xxx versions:
The second and third insertions in each are fine, but the first insertion in each function has the problem you identified. If I use the t2-xxx versions:
All three insertions are as expected. Are you seeing the same inconsistent result? |
Also, as an additional can you add :use-binary t to your database-config parameters and run the above again? I am finding that using this parameter makes all the insertions correct. I am still trying to track down the bad code. |
I got the same inconsistent results as above. This kind of inconsistence is not rare, inserting The PostgreSQL log showed that
This issue seems quite like that of shasht. |
Yes, all cases are correct now. Thanks! |
Now fixed. Thank you for bringing this to our attention. |
Double float may lost precision in INSERT or UPDATE queries with
postmodern:query
.First, we can create a table with a double float column:
Second, execute an INSERT query:
Finally, the value
14.0d0
will be13.999999999999998
in the database.Thanks!
The text was updated successfully, but these errors were encountered: