From 0c2c81b403db420bfce36f168887db72932dbf09 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 6 Mar 2018 21:00:10 -0500 Subject: [PATCH] doc: Add replication parameter to libpq documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Author: Michael Paquier Reported-by: Şahap Aşçı Reviewed-by: Vik Fearing --- doc/src/sgml/libpq.sgml | 58 ++++++++++++++++++++++++++++++++++++++ doc/src/sgml/protocol.sgml | 36 ++++++++++++++++------- 2 files changed, 84 insertions(+), 10 deletions(-) diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 2a8e1f2e07..da9421486b 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1262,6 +1262,64 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname + + replication + + + This option determines whether the connection should use the + replication protocol instead of the normal protocol. This is what + PostgreSQL replication connections as well as tools such as + pg_basebackup use internally, but it can + also be used by third-party applications. For a description of the + replication protocol, consult . + + + + The following values, which are case-insensitive, are supported: + + + + true, on, + yes, 1 + + + + The connection goes into physical replication mode. + + + + + + database + + + The connection goes into logical replication mode, connecting to + the database specified in the dbname parameter. + + + + + + + false, off, + no, 0 + + + + The connection is a regular one, which is the default behavior. + + + + + + + + In physical or logical replication mode, only the simple query protocol + can be used. + + + + sslmode diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 3cec9e0b0c..4fd61d7c2d 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1635,16 +1635,27 @@ that cannot support tls-unique for some reason. To initiate streaming replication, the frontend sends the -replication parameter in the startup message. A Boolean value -of true tells the backend to go into walsender mode, wherein a -small set of replication commands can be issued instead of SQL statements. Only -the simple query protocol can be used in walsender mode. -Replication commands are logged in the server log when - is enabled. -Passing database as the value instructs walsender to connect to -the database specified in the dbname parameter, which will allow -the connection to be used for logical replication from that database. +replication parameter in the startup message. A Boolean +value of true (or on, +yes, 1) tells the backend to go into +physical replication walsender mode, wherein a small set of replication +commands, shown below, can be issued instead of SQL statements. + + + +Passing database as the value for the +replication parameter instructs the backend to go into +logical replication walsender mode, connecting to the database specified in +the dbname parameter. In logical replication walsender +mode, the replication commands shown below as well as normal SQL commands can +be issued. + + + +In either physical replication or logical replication walsender mode, only the +simple query protocol can be used. + For the purpose of testing replication commands, you can make a replication connection via psql or any other libpq-using @@ -1659,7 +1670,12 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;" -The commands accepted in walsender mode are: +Replication commands are logged in the server log when + is enabled. + + + +The commands accepted in replication mode are: IDENTIFY_SYSTEM -- 2.40.0