Menu

Update primary key on the parent table causes error

Help
P Li
2019-09-25
2019-09-26
  • P Li

    P Li - 2019-09-25

    Hi,

    I am using SymmetricDS 3.8 on postgresql. In my database, there is a table with a few child tables. When I update the primary key of a record in the parent table, sds captures the update on the parent table and the implicit update on the child tables. When the changes replicated to the slave database, the update on the parent table is ok but the update on the child table fails. SymmetricDS can't find the child record using the old key (as the child record is implicity updated by the update on the parent record). It tries to insert the record and gets a duplicate primary key error.

    Any suggestion to work around this issue?

    Thanks
    Patrick

     
  • P Li

    P Li - 2019-09-26

    Both my parent and child table have conflict resolution defined. DETECT_TYPE=USE_TIMESTAMP and resolve_type=NEWER_WINS.

    If I deleted the conflict resolution on the child table, I can update the primary key on the parent table without any replication error at the slave!!!

    Why it works without the conflicit resolution?

    Does that mean I can't have custom conflict resolution on the child table if I update the primary key of the parent table?

    Any help will be appreciated.

     

Log in to post a comment.