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
{{ message }}
Repository navigation
Allow configure the order used to synch tables back to postgresql #164
In a scenario where the postgresql/postgis data model has functions and triggers, then is also likely that the tables must be updated following a specific order. This also means that this #145 (comment) should be fixed first, as dbsync fails if a table has a trigger.
The order of sync of tables should not really matter, because when applying changes, we temporarily disable triggers on tables (otherwise such triggers could further modify the database, creating inconsistent state).
Foreign keys are currently not disabled - and indeed this could lead to db-sync errors if the changes are in the diff in the wrong order. This is similar to MerginMaps/geodiff#210 (which concerns geopackages / sqlite driver). In PostgreSQL it should be possible to defer constraint checks to the end of the transaction.
Activity
wonder-sk commentedon Oct 6, 2025
The order of sync of tables should not really matter, because when applying changes, we temporarily disable triggers on tables (otherwise such triggers could further modify the database, creating inconsistent state).
SrNetoChan commentedon Oct 6, 2025
Hi @wonder-sk! How about foreign keys, are those disabled too? Many times one table values depend on other tables rows that may not exist yet.
wonder-sk commentedon Nov 11, 2025
Foreign keys are currently not disabled - and indeed this could lead to db-sync errors if the changes are in the diff in the wrong order. This is similar to MerginMaps/geodiff#210 (which concerns geopackages / sqlite driver). In PostgreSQL it should be possible to defer constraint checks to the end of the transaction.