On Wed, Nov 22, 2017 at 11:36 PM, Michael Paquier <michael.paqu...@gmail.com> wrote: > Yeah, it is mainly a developer option which is why I guess it is not > documented. Like you, I think it should be added as part of the > connection parameter, and mentioned it a couple of days back: > https://www.postgresql.org/message-id/CAB7nPqQAtKfG3H%2BuK11JNivtJtZYE9yVCrPuejRMjp8tUDe0nQ%40mail.gmail.com
Attached is a patch as an attempt to bring together the best of both worlds. The idea is to move the description of how the connection parameter replication works from the replication protocol page into the section of libpq dedicated to connection parameters, and add links between both sections. Thoughts? -- Michael
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 4703309254..09bfcbbec3 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1222,6 +1222,24 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname </listitem> </varlistentry> + <varlistentry id="libpq-connect-replication" xreflabel="replication"> + <term><literal>replication</literal></term> + <listitem> + <para> + This option determines if a backend should use the replication + protocol. A Boolean value of <literal>true</literal> 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. Passing <literal>database</literal> + as the value instructs walsender to connect to the database specified + in the <literal>dbname</literal> parameter, which will allow the + connection to be used for logical replication from that database. + For a detailed description about the replication protocol, consult + <xref linkend="protocol-replication"/>. + </para> + </listitem> + </varlistentry> + <varlistentry id="libpq-connect-sslmode" xreflabel="sslmode"> <term><literal>sslmode</literal></term> <listitem> diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 8174e3defa..b85a3edda9 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1630,15 +1630,9 @@ supported at the moment is <literal>tls-unique</literal>, defined in RFC 5929. <para> To initiate streaming replication, the frontend sends the -<literal>replication</literal> parameter in the startup message. A Boolean value -of <literal>true</literal> 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 +<xref linkend="libpq-connect-replication"/> connection parameter in the +startup message. Replication commands are logged in the server log when <xref linkend="guc-log-replication-commands"/> is enabled. -Passing <literal>database</literal> as the value instructs walsender to connect to -the database specified in the <literal>dbname</literal> parameter, which will allow -the connection to be used for logical replication from that database. </para> <para> For the purpose of testing replication commands, you can make a replication