You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ 9007199254740990
- 9007199254740991
Postgres 12+ is fine.
This value can be correctly stored in both JS and Postgress without precision loss. I believe the problem is default extra_float_digits settings: pre-12, postgres rounded floats to 15 digits when outputting them as text, starting from 12 they switched default to outputting as many digits as necessary to preserve the precision. Setting extra_float_digits to 1 fixes the problem.
There was a similar issue, #730 that is marked as fixed. Might just not be the case for extremely large numbers.
The text was updated successfully, but these errors were encountered:
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.
Fixbrianc#3092
To reproduce:
If used with Postgres < 12, this fails with:
Postgres 12+ is fine.
This value can be correctly stored in both JS and Postgress without precision loss. I believe the problem is default
extra_float_digits
settings: pre-12, postgres rounded floats to 15 digits when outputting them as text, starting from 12 they switched default to outputting as many digits as necessary to preserve the precision. Settingextra_float_digits
to1
fixes the problem.There was a similar issue, #730 that is marked as fixed. Might just not be the case for extremely large numbers.
The text was updated successfully, but these errors were encountered: