I read the source code and found this simple solution, If you configure your trigger as ENABLE REPLICA, it will fire only for replicated rows; if you do as ENABLE ALWAYS, it will fire always.
After creating your trigger, do this ALTER TABLE yourtable ENABLE REPLICA|ALWAYS TRIGGER your_trigger_name Cheers, Will On Wed, Jun 13, 2012 at 10:39 AM, Will <[email protected]> wrote: > Thanks Rosser. > > I searched and found no example or document on how to use > "customcode". I guess I have to dig into bucardo source code and > comment out a few lines. > > Best, > > Will > > On Tue, Jun 12, 2012 at 3:08 PM, Rosser Schwarz > <[email protected]> wrote: >> On Tue, Jun 12, 2012 at 2:51 PM, Will <[email protected]> wrote: >>> One thing I'd like to do is to record the time stamp when a row is >>> replicated over to the subscriber. I created a trigger on the table on >>> the subscriber, hoping when the row is inserted, the trigger would >>> modify the timestamp column and then the row gets inserted. When the >>> row is inserted into the publisher, it is NULL. >> >> During replication, Bucardo disables rules and triggers on the target >> table(s). You might be able to achieve your desired goal with a >> customcode, but I don't have much in the way of practical experience >> with them, so I can't help more specifically than that. >> >> rls >> >> -- >> :wq _______________________________________________ Bucardo-general mailing list [email protected] https://mail.endcrypt.com/mailman/listinfo/bucardo-general
