Re: BUG #15293: Stored Procedure Triggered by Logical Replication is Unable to use Notification Events

Sergei Kornilov <sk@zsrv.org>

From: Sergei Kornilov <sk@zsrv.org>
To: Marc Dean <marc.dean.jr@gmail.com>, Andres Freund <andres@anarazel.de>
Cc: Petr Jelinek <petr@2ndquadrant.com>, "michael.paul.powers@gmail.com" <michael.paul.powers@gmail.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2018-07-24T18:22:18Z
Lists: pgsql-bugs, pgsql-hackers

Attachments

Hello
in fact, I've already tried to build fix. Adding ProcessCompletedNotifies to apply_handle_commit fixed this issue and i think this is right place. In src/backend/tcop/postgres.c we call ProcessCompletedNotifies similar way after commit. This change pass make check-world.
So i attach my two line patch.

regards, Sergei

Commits

  1. Disallow LISTEN in background workers.

  2. Send NOTIFY signals during CommitTransaction.

  3. Make some efficiency improvements in LISTEN/NOTIFY.