-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Precision loss on extremely large floating-point numbers #3093
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
Conversation
Sets `extra_float_digits` setting to 1 when connecting to DB. For older (<12) Postgres, this should be enough to cover all values JS can store preciesely. For 12+ postgres this setting should have no effect. Fix brianc#3092
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this belongs in pg’s use of startup
instead of in pg-protocol. (Side benefit: fewer/no other tests to update, since that’s at least part of why CI is failing right now.)
It also needs to be higher than 1 (take 0.42467013940651843
as a random example), with an accordingly stricter test case. I don’t have time right now to figure out exactly how much precision is enough, but setting it to 3 (https://www.postgresql.org/docs/11/runtime-config-client.html#GUC-EXTRA-FLOAT-DIGITS) is probably fine.
Sets
extra_float_digits
setting to 1 when connecting to DB. For older(<12) Postgres, this should be enough to cover all values JS can store
preciesely. For 12+ postgres this setting should have no effect.
Fix #3092