[Bucardo-general] Own "Triggers" are not working at the other end.
ManuParra
mparra at iaa.es
Thu Sep 9 10:51:49 UTC 2021
Hi Michelle, thanks for your response.
Well, I understand, my idea was to get the delay in data replication, since it originates in one location and appears in the others.
So for this, I can't use the triggers as you indicate, how do you think I could measure those times without the triggers, could I create a trigger on the Bucardo tables that manage the source table that I want to measure, or it wouldn't be possible from there either?
Regards, Manu.
> On 9 Sep 2021, at 11:39, Michelle Sullivan <michelle at sorbs.net> wrote:
>
> As part of the process of replication 5he triggers are disabled.. otherwise you’d have a replication loop as the replication is trigger based.
>
> Michelle Sullivan
> http://www.mhix.org/
> Hallowed are those that walk in unison.
>
>> On 9 Sep 2021, at 19:25, ManuParra <mparra at iaa.es> wrote:
>>
>> Hi, I have Bucardo installed and it works fine, it replicates two locations without any problem.
>>
>> I have created a own trigger to store a benchmarking information in both locations for the same table, if I do an INSERT from one location, the INSERT is replicated in the other, but the trigger that I have created in both locations for a table, only fires from where I execute the INSERT and not in the other location. If I do the insert from the other location the same thing happens, the trigger associated to the table is triggered but it is not triggered in the other location.
>>
>> So my question is, why it doesn't launch its own trigger associated to a table, when the replica comes from another location, how can I solve it?
>>
>> Here is the code of the function and the trigger.
>>
>>
>> CREATE OR REPLACE FUNCTION update_audit()
>> RETURNS TRIGGER
>> LANGUAGE PLPGSQL
>> AS
>> $$
>> BEGIN
>>
>> INSERT INTO logs.audit(key)
>> VALUES(NEW.name);
>>
>> RETURN NEW;
>> END;
>> $$
>>
>> CREATE TRIGGER update_audit
>> AFTER INSERT OR DELETE OR UPDATE ON
>> FOR EACH ROW
>> EXECUTE PROCEDURE update_audit();
>>
>>
>> Regards,
>> Manu
>> _______________________________________________
>> Bucardo-general mailing list
>> Bucardo-general at bucardo.org
>> https://bucardo.org/mailman/listinfo/bucardo-general
More information about the Bucardo-general
mailing list