pgsql: Allow logical decoding via the walsender interface.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow logical decoding via the walsender interface.
Date: 2014-03-10 18:00:38
Message-ID: E1WN4VC-0006RR-Pb@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow logical decoding via the walsender interface.

In order for this to work, walsenders need the optional ability to
connect to a database, so the "replication" keyword now allows true
or false, for backward-compatibility, and the new value "database"
(which causes the "dbname" parameter to be respected).

walsender needs to loop not only when idle but also when sending
decoded data to the user and when waiting for more xlog data to decode.
This means that there are now three separate loops inside walsender.c;
although some refactoring has been done here, this is still a bit ugly.

Andres Freund, with contributions from Álvaro Herrera, and further
review by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5a991ef8692ed0d170b44958a81a6bd70e90585c

Modified Files
--------------
doc/src/sgml/protocol.sgml | 24 +-
src/backend/postmaster/postmaster.c | 28 +-
.../libpqwalreceiver/libpqwalreceiver.c | 6 +-
src/backend/replication/repl_gram.y | 81 +-
src/backend/replication/repl_scanner.l | 1 +
src/backend/replication/walsender.c | 913 +++++++++++++++++---
src/backend/utils/init/postinit.c | 15 +-
src/bin/pg_basebackup/pg_basebackup.c | 4 +-
src/bin/pg_basebackup/pg_receivexlog.c | 4 +-
src/bin/pg_basebackup/receivelog.c | 4 +-
src/include/replication/walsender.h | 1 +
src/tools/pgindent/typedefs.list | 1 +
12 files changed, 915 insertions(+), 167 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2014-03-10 18:06:28 pgsql: Allow dynamic shared memory segments to be kept until shutdown.
Previous Message Robert Haas 2014-03-10 14:23:55 pgsql: Teach on_exit_reset() to discard pending cleanups for dsm.