From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Slony and triggers on slavenodes.
Date: Mon, 18 Feb 2019 13:31:31 +0200
Message-ID: <ddcc711f-0c46-089b-6f27-31cb92e59e2a@matrix.gatewaynet.com> (raw)
In-Reply-To: <89DE7C43D727C04CA77C8B7AB82533CD022B479B3D@WINVMSERV464.ad.smhi.se>
References: <89DE7C43D727C04CA77C8B7AB82533CD022B479B3D@WINVMSERV464.ad.smhi.se>
On 18/2/19 1:09 μ.μ., Gustavsson Mikael wrote:
> 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.
How? can you show the output of \d ? or pg_dump -x --schema-only -t <table_name> ?
>
> 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
>
--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: achill@matrix.gatewaynet.com
Subject: Re: Slony and triggers on slavenodes.
In-Reply-To: <ddcc711f-0c46-089b-6f27-31cb92e59e2a@matrix.gatewaynet.com>
References: <89DE7C43D727C04CA77C8B7AB82533CD022B479B3D@WINVMSERV464.ad.smhi.se> <ddcc711f-0c46-089b-6f27-31cb92e59e2a@matrix.gatewaynet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox