pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedSlony and triggers on slavenodes.
2+ messages / 2 participants
[nested] [flat]
* Slony and triggers on slavenodes.
@ 2019-02-18 11:09 Gustavsson Mikael <mikael.gustavsson@smhi.se>
2019-02-18 11:31 ` Re: Slony and triggers on slavenodes. Achilleas Mantzios <achill@matrix.gatewaynet.com>
0 siblings, 1 reply; 2+ messages in thread
From: Gustavsson Mikael @ 2019-02-18 11:09 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Slony and triggers on slavenodes.
2019-02-18 11:09 Slony and triggers on slavenodes. Gustavsson Mikael <mikael.gustavsson@smhi.se>
@ 2019-02-18 11:31 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
0 siblings, 0 replies; 2+ messages in thread
From: Achilleas Mantzios @ 2019-02-18 11:31 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-02-18 11:31 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 11:09 Slony and triggers on slavenodes. Gustavsson Mikael <mikael.gustavsson@smhi.se>
2019-02-18 11:31 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
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