MerginMaps / geodiff

Library for handling diffs for geospatial data
https://merginmaps.com
MIT License
150 stars 17 forks source link

Incorrect SQL query when there are no updates in the PostgreSQL table #181

Open alexbruy opened 2 years ago

alexbruy commented 2 years ago

If there are no changes in the PostgreSQL table, geodiff generates wrong query to fetch updated columns:

UPDATE "schema"."table" SET  WHERE "id" = 2

As a result it fails to create changeset with the error

Error: apply changeset failed!
GEODIFF: Error: postgres cmd error: ERROR:  syntax error at or near "WHERE"
LINE 1: ... "schema"."table" SET  WHERE "id"...
wonder-sk commented 2 years ago

Normally this should not happen, only with invalid diffs (where update entry has no actual changes recorded), so when this happens, the actual underlying issue is somewhere else...

PeterPetrik commented 1 year ago

@alexbruy do we have some data to replicate the issue?