View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004563||SymmetricDS||Task||public||2020-09-22 09:04||2020-09-30 17:23|
|Summary||0004563: SymmetricDs Triggers can fire before instead of after|
|Description||It 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.
|Tags||data sync, dialect: postgresql, trigger|
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.
|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|