From 0266e98c6b865246c3031bbf55cb15f330134e30 Mon Sep 17 00:00:00 2001
From: Robert Haas
Date: Tue, 5 Oct 2021 12:52:49 -0400
Subject: Flexible options for CREATE_REPLICATION_SLOT.
Like BASE_BACKUP, CREATE_REPLICATION_SLOT has historically used a
hard-coded syntax. To improve future extensibility, adopt a flexible
options syntax here, too.
In the new syntax, instead of three mutually exclusive options
EXPORT_SNAPSHOT, USE_SNAPSHOT, and NOEXPORT_SNAPSHOT, there is now a single
SNAPSHOT option with three possible values: 'export', 'use', and 'nothing'.
This commit does not remove support for the old syntax. It just adds
the new one as an additional option, makes pg_receivewal,
pg_recvlogical, and walreceiver processes use it.
Patch by me, reviewed by Fabien Coelho, Sergei Kornilov, and
Fujii Masao.
Discussion: http://postgr.es/m/CA+TgmobAczXDRO_Gr2euo_TxgzaH1JxbNxvFx=HYvBinefNH8Q@mail.gmail.com
Discussion: http://postgr.es/m/CA+TgmoZGwR=ZVWFeecncubEyPdwghnvfkkdBe9BLccLSiqdf9Q@mail.gmail.com
---
doc/src/sgml/protocol.sgml | 37 ++++++++++++++++++++++++++-----------
1 file changed, 26 insertions(+), 11 deletions(-)
(limited to 'doc/src')
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 8ed88334442..b95cc88599a 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -1914,7 +1914,7 @@ The commands accepted in replication mode are:
- CREATE_REPLICATION_SLOT slot_name [ TEMPORARY ] { PHYSICAL [ RESERVE_WAL ] | LOGICAL output_plugin [ EXPORT_SNAPSHOT | NOEXPORT_SNAPSHOT | USE_SNAPSHOT | TWO_PHASE ] }
+ CREATE_REPLICATION_SLOT slot_name [ TEMPORARY ] { PHYSICAL | LOGICAL } [ ( option [, ...] ) ]
CREATE_REPLICATION_SLOT
@@ -1954,46 +1954,50 @@ The commands accepted in replication mode are:
+
+
+ The following options are supported:
+
- TWO_PHASE
+ TWO_PHASE [ boolean ]
- Specify that this logical replication slot supports decoding of two-phase
+ If true, this logical replication slot supports decoding of two-phase
transactions. With this option, two-phase commands like
PREPARE TRANSACTION, COMMIT PREPARED
and ROLLBACK PREPARED are decoded and transmitted.
The transaction will be decoded and transmitted at
PREPARE TRANSACTION time.
+ The default is false.
- RESERVE_WAL
+ RESERVE_WAL [ boolean ]
- Specify that this physical replication slot reserves WAL
+ If true, this physical replication slot reserves WAL
immediately. Otherwise, WAL is only reserved upon
connection from a streaming replication client.
+ The default is false.
- EXPORT_SNAPSHOT
- NOEXPORT_SNAPSHOT
- USE_SNAPSHOT
+ SNAPSHOT { 'export' | 'use' | 'nothing' }
Decides what to do with the snapshot created during logical slot
- initialization. EXPORT_SNAPSHOT, which is the default,
+ initialization. 'export', which is the default,
will export the snapshot for use in other sessions. This option can't
- be used inside a transaction. USE_SNAPSHOT will use the
+ be used inside a transaction. 'use' will use the
snapshot for the current transaction executing the command. This
option must be used in a transaction, and
CREATE_REPLICATION_SLOT must be the first command
- run in that transaction. Finally, NOEXPORT_SNAPSHOT will
+ run in that transaction. Finally, 'nothing' will
just use the snapshot for logical decoding as normal but won't do
anything else with it.
@@ -2052,6 +2056,17 @@ The commands accepted in replication mode are:
+
+ CREATE_REPLICATION_SLOT slot_name [ TEMPORARY ] { PHYSICAL [ RESERVE_WAL ] | LOGICAL output_plugin [ EXPORT_SNAPSHOT | NOEXPORT_SNAPSHOT | USE_SNAPSHOT | TWO_PHASE ] }
+
+
+
+ For compatibility with older releases, this alternative syntax for
+ the CREATE_REPLICATION_SLOT command is still supported.
+
+
+
+
START_REPLICATION [ SLOT slot_name ] [ PHYSICAL ] XXX/XXX [ TIMELINE tli ]
START_REPLICATION
--
cgit v1.2.3