From 6265265b8fb23d5b2192c77b5773eea0f3b181fa Mon Sep 17 00:00:00 2001 From: Emre Hasegeli Date: Mon, 20 Mar 2023 17:02:45 +0100 Subject: [PATCH v02 2/2] pgoutput: Document missing options Author: Emre Hasegeli Reviewed-by: Peter Smith Reviewed-by: Amit Kapila Backpatch-through: 14 Discussion: https://www.postgresql.org/message-id/flat/CAE2gYzwdwtUbs-tPSV-QBwgTubiyGD2ZGsSnAVsDfAGGLDrGOA%40mail.gmail.com --- doc/src/sgml/logical-replication.sgml | 3 +- doc/src/sgml/protocol.sgml | 92 +++++++++++++++++++++++++-- 2 files changed, 88 insertions(+), 7 deletions(-) diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index 1bb85e4ad9..e7fd1a38b2 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -1655,21 +1655,22 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER transactional consistency is guaranteed for the publications within any single subscription. Logical replication is built with an architecture similar to physical streaming replication (see ). It is implemented by walsender and apply processes. The walsender process starts logical decoding (described in ) of the WAL and loads the standard - logical decoding plugin (pgoutput). The plugin transforms the changes read + logical decoding plugin (pgoutput). The plugin + transforms the changes read from WAL to the logical replication protocol (see ) and filters the data according to the publication specification. The data is then continuously transferred using the streaming replication protocol to the apply worker, which maps the data to local tables and applies the individual changes as they are received, in correct transactional order. The apply process on the subscriber database always runs with diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index af3f016f74..6605e2aede 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -2539,20 +2539,22 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;" The WAL location to begin streaming at. option_name The name of an option passed to the slot's logical decoding plugin. + See for options that + are accepted by the standard (pgoutput) plugin. option_value Optional value, in the form of a string constant, associated with the specified option. @@ -3075,36 +3077,43 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;" flow started by the START_REPLICATION SLOT slot_name LOGICAL replication command. The logical streaming replication protocol builds on the primitives of the physical streaming replication protocol. + + PostgreSQL supports extensible logical decoding + plugins. pgoutput is the standard one used for + the built-in logical replication. + + Logical Streaming Replication Parameters - The logical replication START_REPLICATION command - accepts following parameters: + Using the START_REPLICATION command, + pgoutput accepts the following options: proto_version - Protocol version. Currently versions 1, 2, - 3, and 4 are supported. + Protocol version. Required. Currently versions 1, + 2, 3, and 4 + are supported. Version 2 is supported only for server version 14 and above, and it allows streaming of large in-progress transactions. Version 3 is supported only for server version 15 and above, and it allows streaming of two-phase commits. @@ -3115,22 +3124,93 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;" publication_names Comma separated list of publication names for which to subscribe - (receive changes). The individual publication names are treated - as standard objects names and can be quoted the same as needed. + (receive changes). Required. The individual publication names are + treated as standard objects names and can be quoted the same as needed. + + + + + + + + binary + + + + Boolean option to use binary transfer mode. Binary mode is faster + than the text mode but slightly less robust. + + + + + + + + messages + + + + Boolean option to enable sending the messages that are written + by pg_logical_emit_message. + + + + + + + + streaming + + + + Boolean option to enable streaming of in-progress transactions. + It accepts an additional value "parallel" to enable sending extra + information with some messages to be used for parallelisation. + Minimum protocol version 2 is required to turn it on. Minimum protocol + version 4 is required for the "parallel" option. + + + + + + + + two_phase + + + + Boolean option to enable two-phase transactions. Minimum protocol + version 3 is required to turn it on. + + + + + + + + origin + + + + Option to send changes by their origin. Possible values are "none" + to only send the changes that have no origin associated, or "any" + to send the changes regardless of their origin. This can be used + to avoid loops (infinite replication of the same data) among + replication nodes. Logical Replication Protocol Messages -- 2.39.3 (Apple Git-145)