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
