Notify from trigger on pglogical replicated table

萝らか妹 提交于 2019-12-11 06:08:06

问题


I'm trying to setup a push-from-server functionality based on PostgreSQL, pglogical and PostgreSQL's listen-notify mechanism. On my replicated table I've setup a trigger that uses pg_notify to push messages to queue after insert. Altered the trigger to "enable always trigger". With this setup, the behavior is not what I expected.

After setting up a listen client (another postgresql console, also tried multiple python drivers, behavior is always the same), I don't get the notifications until I send another notification from another process that is not triggered by replication. Once I send the notification by hand, I get all the notifications pushed from the trigger alongside the one I've sent manually.

Any help appreciated.


回答1:


This is a bug with PostgreSQL. NOTIFY's coming from triggers that are triggered by logical replication don't properly trigger notifications. It's getting worked on.

Followed here from this question.



来源:https://stackoverflow.com/questions/48641038/notify-from-trigger-on-pglogical-replicated-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!