Slony and triggers on slavenodes. - Mailing list pgsql-general

From Gustavsson Mikael
Subject Slony and triggers on slavenodes.
Date
Msg-id 89DE7C43D727C04CA77C8B7AB82533CD022B479B3D@WINVMSERV464.ad.smhi.se
Whole thread Raw
Responses Re: Slony and triggers on slavenodes.  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-general
Hi,

I have a Postgresql 11 and Slony 2.2.7 setup with one master and multiple slave nodes. On one of the slaves I want a user defined trigger to fire on insert. The trigger fires a notify function.

Now to the problem.

If I create the trigger it looks like it is enabled on the slave but it do not fire.

CREATE TRIGGER <trigger_name>
    AFTER INSERT
    ON <table_name>
    FOR EACH ROW
    EXECUTE PROCEDURE <function_name>;

If i try to enable it explicit with

ALTER TABLE <table_name>
ENABLE ALWAYS TRIGGER <trigger_name>;

or

ALTER TABLE <table_name>
ENABLE REPLICA TRIGGER <trigger_name>;

and then look at the table definition the trigger is disabled.

Is this expected behavior in slony?
I understand that this may be tricky in replication context and that the default behavior is that triggers on slaves are disabled.

We have plans to move to logical replication which should solve this I assume, but it does not fit the schedule at the moment.

KR
Mikael Gustavsson

pgsql-general by date:

Previous
From: Vijaykumar Jain
Date:
Subject: Re: [External] Re: FDW, too long to run explain
Next
From: Achilleas Mantzios
Date:
Subject: Re: Slony and triggers on slavenodes.