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 <[email protected]> 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 <[email protected]> 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 >> [email protected] >> https://bucardo.org/mailman/listinfo/bucardo-general _______________________________________________ Bucardo-general mailing list [email protected] https://bucardo.org/mailman/listinfo/bucardo-general
