-
Notifications
You must be signed in to change notification settings - Fork 17
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
apply: error deleting rows due to date/time mismatch #143
Comments
We already have special handling of date/time values when it comes to creation of UPDATE statements (https://github.com/lutraconsulting/geodiff/blob/master/geodiff/src/drivers/sqlitedriver.cpp#L497), we should apply that also when creating/applying DELETE statements.
|
Hi @wonder-sk is this scheduled in your development timeline or could we speed it up somehow, maybe fund a part of the development? please let me know. cheers |
This fixes the issue when applying a diff with date/time values, but the representation of date/time values as strings is slightly different even though they refer to the same date/time. Fixes both the case with update and the case with delete. Insert does not need fixing as there is no comparison with previous values.
This fixes the issue when applying a diff with date/time values, but the representation of date/time values as strings is slightly different even though they refer to the same date/time. Fixes both the case with update and the case with delete. Insert does not need fixing as there is no comparison with previous values.
When using db-sync, it was seen (MerginMaps/db-sync#50) that if a table is synced from geopackage to postgresql, some rows are removed and then the diff is applied back on the geopackage, it may happen that applying the diff fails due to subtle difference in how date/time is stored.
The original data may contain date/time values like this:
2021-03-16T00:00:00
Diff returning from postgresql was referring to values including Zulu timezone:
2021-03-16T00:00:00Z
When deleting rows, this mismatch of what is stored in SQLite and what is stored in diff causes the error.
A temporary fix for this issue is to add the "Z" suffix to the source data, in sqlite the batch command may look like this:
The text was updated successfully, but these errors were encountered: