View Issue Details

IDProjectCategoryView StatusLast Update
0004563SymmetricDSTaskpublic2020-09-30 17:23
Reporteradrian Assigned To 
Priorityhigh 
Status feedbackResolutionopen 
Product Version3.11.10 
Summary0004563: SymmetricDs Triggers can fire before instead of after
DescriptionIt is possible to create symmetricds triggers that are fire before the sql statement, that is, if they can be created as an "after" trigger instead of "before" trigger?
This is done in PostgreSql 11.
Tagsdata sync, dialect: postgresql, trigger

Activities

elong

2020-09-30 17:23

developer   ~0001793

Why do you want a "before" trigger? One disadvantage of firing before constraint checks is that the data ID sequence will roll forward and leave gaps, which causes heavier processing in routing.

Some people want custom triggers on a table that will change data in another table. For the rows to be captured in the right order, SymmetricDS needs its trigger to execute first. Postgres trigger execution is alphabetical by name. You can specify the SymmetricDS trigger name on sym_trigger.NAME_FOR_INSERT/UPDATE/DELETE_TRIGGER field. Prefix the name with '00' and it will execute first.

Issue History

Date Modified Username Field Change
2020-09-22 09:04 adrian New Issue
2020-09-22 09:04 adrian Tag Attached: data sync
2020-09-22 09:04 adrian Tag Attached: dialect: postgresql
2020-09-22 09:04 adrian Tag Attached: trigger
2020-09-30 17:23 elong Status new => feedback
2020-09-30 17:23 elong Note Added: 0001793