[Bucardo-general] target table trigger not fired

Will vocalster.app at gmail.com
Wed Jun 13 21:26:10 UTC 2012


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 <vocalster.app at gmail.com> 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
> <rosser.schwarz at gmail.com> wrote:
>> On Tue, Jun 12, 2012 at 2:51 PM, Will <vocalster.app at gmail.com> 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


More information about the Bucardo-general mailing list