@@ -21,23 +21,12 @@ PostgreSQL documentation
2121
2222 <refsynopsisdiv>
2323<synopsis>
24- ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> WITH ( <replaceable class="PARAMETER">suboption</replaceable> [, ... ] )
25-
26- <phrase>where <replaceable class="PARAMETER">suboption</replaceable> can be:</phrase>
27-
28- SLOT NAME = <replaceable class="PARAMETER">slot_name</replaceable>
29- | SYNCHRONOUS_COMMIT = <replaceable class="PARAMETER">synchronous_commit</replaceable>
30-
31- ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> SET PUBLICATION <replaceable class="PARAMETER">publication_name</replaceable> [, ...] { REFRESH WITH ( <replaceable class="PARAMETER">puboption</replaceable> [, ... ] ) | NOREFRESH }
32- ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> REFRESH PUBLICATION [ WITH ( <replaceable class="PARAMETER">puboption</replaceable> [, ... ] ) ]
33-
34- <phrase>where <replaceable class="PARAMETER">puboption</replaceable> can be:</phrase>
35-
36- COPY DATA | NOCOPY DATA
37-
3824ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> CONNECTION '<replaceable>conninfo</replaceable>'
25+ ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> SET PUBLICATION <replaceable class="PARAMETER">publication_name</replaceable> [, ...] { REFRESH [ WITH ( <replaceable class="PARAMETER">refresh_option</replaceable> <replaceable class="PARAMETER">value</replaceable> [, ... ] ) ] | SKIP REFRESH }
26+ ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> REFRESH PUBLICATION [ WITH ( <replaceable class="PARAMETER">refresh_option</replaceable> <replaceable class="PARAMETER">value</replaceable> [, ... ] ) ]
3927ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> ENABLE
4028ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> DISABLE
29+ ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> SET ( <replaceable class="parameter">subscription_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )
4130ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
4231ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> RENAME TO <replaceable>new_name</replaceable>
4332</synopsis>
@@ -73,11 +62,9 @@ ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> RENAME TO <
7362
7463 <varlistentry>
7564 <term><literal>CONNECTION '<replaceable class="parameter">conninfo</replaceable>'</literal></term>
76- <term><literal>SLOT NAME = <replaceable class="parameter">slot_name</replaceable></literal></term>
77- <term><literal>SYNCHRONOUS_COMMIT = <replaceable class="PARAMETER">synchronous_commit</replaceable></literal></term>
7865 <listitem>
7966 <para>
80- These clauses alter properties originally set by
67+ This clause alters the connection property originally set by
8168 <xref linkend="SQL-CREATESUBSCRIPTION">. See there for more
8269 information.
8370 </para>
@@ -91,11 +78,17 @@ ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> RENAME TO <
9178 Changes list of subscribed publications. See
9279 <xref linkend="SQL-CREATESUBSCRIPTION"> for more information.
9380 </para>
81+
9482 <para>
95- When <literal>REFRESH</literal> is specified, this command will also
96- act like <literal>REFRESH PUBLICATION</literal>. When
97- <literal>NOREFRESH</literal> is specified, the comamnd will not try to
98- refresh table information.
83+ When <literal>REFRESH</literal> is specified, this command will also act
84+ like <literal>REFRESH
85+ PUBLICATION</literal>. <literal>refresh_option</literal> specifies
86+ additional options for the refresh operation, as described
87+ under <literal>REFRESH PUBLICATION</literal>. When
88+ <literal>SKIP REFRESH</literal> is specified, the command will not try
89+ to refresh table information. Note that
90+ either <literal>REFRESH</literal> or <literal>SKIP REFRESH</literal>
91+ must be specified.
9992 </para>
10093 </listitem>
10194 </varlistentry>
@@ -104,16 +97,28 @@ ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> RENAME TO <
10497 <term><literal>REFRESH PUBLICATION</literal></term>
10598 <listitem>
10699 <para>
107- Fetch missing table information from publisher. This will start
100+ Fetch missing table information from publisher. This will start
108101 replication of tables that were added to the subscribed-to publications
109102 since the last invocation of <command>REFRESH PUBLICATION</command> or
110103 since <command>CREATE SUBSCRIPTION</command>.
111104 </para>
105+
112106 <para>
113- The <literal>COPY DATA</literal> and <literal>NOCOPY DATA</literal>
114- options specify if the existing data in the publications that are being
115- subscribed to should be copied. <literal>COPY DATA</literal> is the
116- default.
107+ <literal>refresh_option</literal> specifies additional options for the
108+ refresh operation. The supported options are:
109+
110+ <variablelist>
111+ <varlistentry>
112+ <term><literal>copy_data</literal> (<type>boolean</type>)</term>
113+ <listitem>
114+ <para>
115+ Specifies whether the existing data in the publications that are
116+ being subscribed to should be copied once the replication starts.
117+ The default is <literal>true</literal>.
118+ </para>
119+ </listitem>
120+ </varlistentry>
121+ </variablelist>
117122 </para>
118123 </listitem>
119124 </varlistentry>
@@ -138,6 +143,18 @@ ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> RENAME TO <
138143 </listitem>
139144 </varlistentry>
140145
146+ <varlistentry>
147+ <term><literal>SET ( <replaceable class="parameter">subscription_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )</literal></term>
148+ <listitem>
149+ <para>
150+ This clause alters parameters originally set by
151+ <xref linkend="SQL-CREATESUBSCRIPTION">. See there for more
152+ information. The allowed options are <literal>slot_name</literal> and
153+ <literal>synchronous_commit</literal>
154+ </para>
155+ </listitem>
156+ </varlistentry>
157+
141158 <varlistentry>
142159 <term><replaceable class="parameter">new_owner</replaceable></term>
143160 <listitem>
@@ -165,7 +182,7 @@ ALTER SUBSCRIPTION <replaceable class="PARAMETER">name</replaceable> RENAME TO <
165182 Change the publication subscribed by a subscription to
166183 <literal>insert_only</literal>:
167184<programlisting>
168- ALTER SUBSCRIPTION mysub SET PUBLICATION insert_only;
185+ ALTER SUBSCRIPTION mysub SET PUBLICATION insert_only REFRESH ;
169186</programlisting>
170187 </para>
171188
0 commit comments