Allow pgoutput to send logical decoding messages

Enterprise / PostgreSQL - Amit Kapila [postgresql.org] - 6 April 2021 03:10 UTC

The output plugin accepts a new parameter (messages) that controls if logical decoding messages are written into the replication stream. It is useful for those clients that use pgoutput as an output plugin and needs to process messages that were written by pg_logical_emit_message().

Although logical streaming replication protocol supports logical decoding messages now, logical replication does not use this feature yet.

Author: David Pirotte, Euler Taveira

ac4645c015 Allow pgoutput to send logical decoding messages.
doc/src/sgml/protocol.sgml | 76 ++++++++++++++
src/backend/replication/logical/proto.c | 28 ++++++
src/backend/replication/logical/worker.c | 9 ++
src/backend/replication/pgoutput/pgoutput.c | 47 +++++++++
src/include/replication/logicalproto.h | 3 +
src/include/replication/pgoutput.h | 1 +
src/test/subscription/t/020_messages.pl | 148 ++++++++++++++++++++++++++++
7 files changed, 312 insertions(+)

Upstream: git.postgresql.org


  • Share