Documenting that queries can be run over replication protocol

Started by Chris Traversover 7 years ago2 messages
#1Chris Travers
chris.travers@adjust.com
1 attachment(s)

Hi;

In the process of building some tooling based on replication we discovered
that PostgreSQL 10 uses COPY to populate the initial table on logical
replication, see commit 7c4f52409a8c7d85ed169bbbc1f6092274d03920

This is not currently documented. Attached is a patch which adds that
documentation to the logical replication part of the protocol section.

--
Best Regards,
Chris Travers
Database Administrator

Tel: +49 162 9037 210 | Skype: einhverfr | www.adjust.com
Saarbrücker Straße 37a, 10405 Berlin

Attachments:

logical_replication_sql_doc.diffapplication/octet-stream; name=logical_replication_sql_doc.diffDownload
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 46d7e19f10..5ad37b0487 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -1696,6 +1696,13 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
  <xref linkend="app-pgrecvlogical"/> (for logical replication).
 </para>
 
+<para>
+Where replication=database, simple queries may be executed. Other than access to decoded
+sets and physical files, there are no special rules for permissions on such queries.  This means
+programs can combine logical replication with other operations, but no parameterized queries
+may be used.
+</para>
+
 <para>
 Replication commands are logged in the server log when
 <xref linkend="guc-log-replication-commands"/> is enabled.
#2Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: Chris Travers (#1)
Re: Documenting that queries can be run over replication protocol

On 24/07/2018 09:54, Chris Travers wrote:

In the process of building some tooling based on replication we
discovered that PostgreSQL 10 uses COPY to populate the initial table on
logical replication, see commit 7c4f52409a8c7d85ed169bbbc1f6092274d03920

This is not currently documented.  Attached is a patch which adds that
documentation to the logical replication part of the protocol section.

It already says earlier in that same section:

"In logical replication walsender mode, the replication commands shown
below as well as normal SQL commands can be issued."

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services