logical-replication

PostgreSQL logical replication - create subscription hangs

核能气质少年 提交于 2019-12-11 17:55:43
问题 I am trying to set logical replication between 2 cloud instances both with Debian 9 and PG 11.1. The command CREATE PUBLICATION on master was successful, but when I start the command CREATE SUBSCRIPTION on the intended logical replica, the command hangs indefinitely. On the master I can see that the replication slot was created and is active and I can see a new walsender process created and "waiting" and in the log on the master I see these these lines: 2019-01-14 14:20:39.924 UTC [8349] repl

Postgres Notify not working with logical replication

泪湿孤枕 提交于 2019-12-10 16:14:42
问题 I am replicating data from Postgres 10.4 to another Postgres 10.4 instance using logical replication. The subscriber has several triggers that log events to a single table. This table has a trigger that executes another function (that returns a trigger) to call NOTIFY for a downstream listener. Trigger on the audit table looks like this: CREATE TRIGGER queue_insert AFTER INSERT ON schema_name.table_name FOR EACH ROW EXECUTE PROCEDURE notify_downstream() GO Notify downstream definition: CREATE