pgsql: Generic Messages for Logical Decoding

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Generic Messages for Logical Decoding
Date: 2016-04-06 09:08:19
Message-ID: E1anjRj-0000Nn-S3@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Generic Messages for Logical Decoding

API and mechanism to allow generic messages to be inserted into WAL that are
intended to be read by logical decoding plugins. This commit adds an optional
new callback to the logical decoding API.

Messages are either text or bytea. Messages can be transactional, or not, and
are identified by a prefix to allow multiple concurrent decoding plugins.

(Not to be confused with Generic WAL records, which are intended to allow crash
recovery of extensible objects.)

Author: Petr Jelinek and Andres Freund
Reviewers: Artur Zakirov, Tomas Vondra, Simon Riggs
Discussion: 5685F999(dot)6010202(at)2ndquadrant(dot)com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3fe3511d05127cc024b221040db2eeb352e7d716

Modified Files
--------------
contrib/test_decoding/Makefile | 2 +-
contrib/test_decoding/expected/ddl.out | 21 ++--
contrib/test_decoding/expected/messages.out | 79 ++++++++++++++++
contrib/test_decoding/sql/ddl.sql | 3 +-
contrib/test_decoding/sql/messages.sql | 25 +++++
contrib/test_decoding/test_decoding.c | 18 ++++
doc/src/sgml/func.sgml | 45 +++++++++
doc/src/sgml/logicaldecoding.sgml | 38 ++++++++
src/backend/access/rmgrdesc/Makefile | 6 +-
src/backend/access/rmgrdesc/logicalmsgdesc.c | 41 ++++++++
src/backend/access/transam/rmgr.c | 1 +
src/backend/replication/logical/Makefile | 2 +-
src/backend/replication/logical/decode.c | 46 +++++++++
src/backend/replication/logical/logical.c | 38 ++++++++
src/backend/replication/logical/logicalfuncs.c | 27 ++++++
src/backend/replication/logical/message.c | 87 +++++++++++++++++
src/backend/replication/logical/reorderbuffer.c | 121 ++++++++++++++++++++++++
src/backend/replication/logical/snapbuild.c | 19 ++++
src/bin/pg_xlogdump/.gitignore | 21 +---
src/bin/pg_xlogdump/rmgrdesc.c | 1 +
src/include/access/rmgrlist.h | 1 +
src/include/catalog/pg_proc.h | 4 +
src/include/replication/logicalfuncs.h | 2 +
src/include/replication/message.h | 41 ++++++++
src/include/replication/output_plugin.h | 13 +++
src/include/replication/reorderbuffer.h | 22 +++++
src/include/replication/snapbuild.h | 2 +
27 files changed, 693 insertions(+), 33 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2016-04-06 09:09:05 Re: [HACKERS] pgsql: Avoid archiving XLOG_RUNNING_XACTS on idle server
Previous Message Simon Riggs 2016-04-06 09:04:42 Re: [COMMITTERS] pgsql: Avoid archiving XLOG_RUNNING_XACTS on idle server