diff options
author | Amit Kapila <akapila@postgresql.org> | 2021-04-06 08:40:47 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2021-04-06 08:40:47 +0530 |
commit | ac4645c0157fc5fcef0af8ff571512aa284a2cec (patch) | |
tree | a414a4b21e4a79ac04cd67b8ed4ac907d9856f76 /src/include/replication/logicalproto.h | |
parent | 531737ddad214cb8a675953208e2f3a6b1be122b (diff) | |
download | postgresql-ac4645c0157fc5fcef0af8ff571512aa284a2cec.tar.gz postgresql-ac4645c0157fc5fcef0af8ff571512aa284a2cec.zip |
Allow pgoutput to send logical decoding messages.
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
Reviewed-by: Euler Taveira, Andres Freund, Ashutosh Bapat, Amit Kapila
Discussion: https://postgr.es/m/CADK3HHJ-+9SO7KuRLH=9Wa1rAo60Yreq1GFNkH_kd0=CdaWM+A@mail.gmail.com
Diffstat (limited to 'src/include/replication/logicalproto.h')
-rw-r--r-- | src/include/replication/logicalproto.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/replication/logicalproto.h b/src/include/replication/logicalproto.h index fa4c37277b1..55b90c03eac 100644 --- a/src/include/replication/logicalproto.h +++ b/src/include/replication/logicalproto.h @@ -54,6 +54,7 @@ typedef enum LogicalRepMsgType LOGICAL_REP_MSG_TRUNCATE = 'T', LOGICAL_REP_MSG_RELATION = 'R', LOGICAL_REP_MSG_TYPE = 'Y', + LOGICAL_REP_MSG_MESSAGE = 'M', LOGICAL_REP_MSG_STREAM_START = 'S', LOGICAL_REP_MSG_STREAM_END = 'E', LOGICAL_REP_MSG_STREAM_COMMIT = 'c', @@ -151,6 +152,8 @@ extern void logicalrep_write_truncate(StringInfo out, TransactionId xid, bool cascade, bool restart_seqs); extern List *logicalrep_read_truncate(StringInfo in, bool *cascade, bool *restart_seqs); +extern void logicalrep_write_message(StringInfo out, TransactionId xid, XLogRecPtr lsn, + bool transactional, const char *prefix, Size sz, const char *message); extern void logicalrep_write_rel(StringInfo out, TransactionId xid, Relation rel); extern LogicalRepRelation *logicalrep_read_rel(StringInfo in); |