Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Floating point comparison issue #289
When Postico creates update statements for tables without primary keys or for views, it compares the value of every row. When there are floating point columns, rounding issues can prevent rows from matching.
This causes errors like "the transaction did not affect the expected number of rows"
I have to investigate exactly how PostgreSQL compares floats, I'm not sure where this is s coming from.
After investigating the issue, I've discovered that the problem is caused by the fact that PostgreSQL does not send sufficient digits for floats and doubles to uniquely identify them. I was able to fix this problem by setting the "extra_float_digits" parameter to 3.
Unfortunately, the value 3 is not allowed before PostgreSQL 9.0 (including Amazon Redshift). Postico automatically detects this error and sets the parameter to 2 instead. For doubles this does not cause any issues, but it can cause problems with floats. For this reason, I recommend not to use floats with versions of PostgreSQL before 9.0, especially in tables that lack a primary key.
The fix is in build 1710. I still need to test if this new connection parameter works with Redshift and CockroachDB