aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-07-18 12:44:51 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-07-18 12:44:51 -0400
commit9de77b5453130242654ff0b30a551c9c862ed661 (patch)
tree9c48ed25ee4711934006078939a834186c8e9727 /doc/src/sgml/ref
parent9add405014f8e47e038af7124528b7601249a2ac (diff)
downloadpostgresql-9de77b5453130242654ff0b30a551c9c862ed661.tar.gz
postgresql-9de77b5453130242654ff0b30a551c9c862ed661.zip
Allow logical replication to transfer data in binary format.
This patch adds a "binary" option to CREATE/ALTER SUBSCRIPTION. When that's set, the publisher will send data using the data type's typsend function if any, rather than typoutput. This is generally faster, if slightly less robust. As committed, we won't try to transfer user-defined array or composite types in binary, for fear that type OIDs won't match at the subscriber. This might be changed later, but it seems like fit material for a follow-on patch. Dave Cramer, reviewed by Daniel Gustafsson, Petr Jelinek, and others; adjusted some by me Discussion: https://postgr.es/m/CADK3HH+R3xMn=8t3Ct+uD+qJ1KD=Hbif5NFMJ+d5DkoCzp6Vgw@mail.gmail.com
Diffstat (limited to 'doc/src/sgml/ref')
-rw-r--r--doc/src/sgml/ref/alter_subscription.sgml6
-rw-r--r--doc/src/sgml/ref/create_subscription.sgml26
2 files changed, 28 insertions, 4 deletions
diff --git a/doc/src/sgml/ref/alter_subscription.sgml b/doc/src/sgml/ref/alter_subscription.sgml
index c24ace14d10..81c4e70cdf4 100644
--- a/doc/src/sgml/ref/alter_subscription.sgml
+++ b/doc/src/sgml/ref/alter_subscription.sgml
@@ -163,8 +163,10 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
<para>
This clause alters parameters originally set by
<xref linkend="sql-createsubscription"/>. See there for more
- information. The allowed options are <literal>slot_name</literal> and
- <literal>synchronous_commit</literal>
+ information. The parameters that can be altered
+ are <literal>slot_name</literal>,
+ <literal>synchronous_commit</literal>, and
+ <literal>binary</literal>.
</para>
</listitem>
</varlistentry>
diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml
index 5bbc165f70d..cdb22c54fea 100644
--- a/doc/src/sgml/ref/create_subscription.sgml
+++ b/doc/src/sgml/ref/create_subscription.sgml
@@ -152,8 +152,9 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
<listitem>
<para>
The value of this parameter overrides the
- <xref linkend="guc-synchronous-commit"/> setting. The default
- value is <literal>off</literal>.
+ <xref linkend="guc-synchronous-commit"/> setting within this
+ subscription's apply worker processes. The default value
+ is <literal>off</literal>.
</para>
<para>
@@ -179,6 +180,27 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
</varlistentry>
<varlistentry>
+ <term><literal>binary</literal> (<type>boolean</type>)</term>
+ <listitem>
+ <para>
+ Specifies whether the subscription will request the publisher to
+ send the data in binary format (as opposed to text).
+ The default is <literal>false</literal>.
+ Even when this option is enabled, only data types that have
+ binary send and receive functions will be transferred in binary.
+ </para>
+
+ <para>
+ When doing cross-version replication, it could happen that the
+ publisher has a binary send function for some data type, but the
+ subscriber lacks a binary receive function for the type. In
+ such a case, data transfer will fail, and
+ the <literal>binary</literal> option cannot be used.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><literal>connect</literal> (<type>boolean</type>)</term>
<listitem>
<para>