Skip to content

Allow configure the order used to synch tables back to postgresql #164

Open

Description

@gioman

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.

Activity

  1. wonder-sk commented on Oct 6, 2025

    @wonder-sk
    Contributor

    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).

  2. SrNetoChan commented on Oct 6, 2025

    @SrNetoChan

    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.

  3. wonder-sk commented on Nov 11, 2025

    @wonder-sk
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions