@@ -92,17 +92,39 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
92
92
<term><literal>WITH ( <replaceable class="parameter">subscription_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )</literal></term>
93
93
<listitem>
94
94
<para>
95
- This clause specifies optional parameters for a subscription. The
96
- following parameters are supported:
95
+ This clause specifies optional parameters for a subscription.
96
+ </para>
97
+
98
+ <para>
99
+ The following parameters control what happens during subscription creation:
97
100
98
101
<variablelist>
102
+
99
103
<varlistentry>
100
- <term><literal>copy_data </literal> (<type>boolean</type>)</term>
104
+ <term><literal>connect </literal> (<type>boolean</type>)</term>
101
105
<listitem>
102
106
<para>
103
- Specifies whether the existing data in the publications that are
104
- being subscribed to should be copied once the replication starts.
105
- The default is <literal>true</literal>.
107
+ Specifies whether the <command>CREATE SUBSCRIPTION</command>
108
+ should connect to the publisher at all. Setting this to
109
+ <literal>false</literal> will change default values of
110
+ <literal>enabled</literal>, <literal>create_slot</literal> and
111
+ <literal>copy_data</literal> to <literal>false</literal>.
112
+ </para>
113
+
114
+ <para>
115
+ It is not allowed to combine <literal>connect</literal> set to
116
+ <literal>false</literal> and <literal>enabled</literal>,
117
+ <literal>create_slot</literal>, or <literal>copy_data</literal>
118
+ set to <literal>true</literal>.
119
+ </para>
120
+
121
+ <para>
122
+ Since no connection is made when this option is set
123
+ to <literal>false</literal>, the tables are not subscribed, and so
124
+ after you enable the subscription nothing will be replicated.
125
+ It is required to run
126
+ <literal>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</literal> in order
127
+ for tables to be subscribed.
106
128
</para>
107
129
</listitem>
108
130
</varlistentry>
@@ -146,38 +168,13 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
146
168
</para>
147
169
</listitem>
148
170
</varlistentry>
171
+ </variablelist>
172
+ </para>
149
173
150
- <varlistentry>
151
- <term><literal>synchronous_commit</literal> (<type>enum</type>)</term>
152
- <listitem>
153
- <para>
154
- The value of this parameter overrides the
155
- <xref linkend="guc-synchronous-commit"/> setting within this
156
- subscription's apply worker processes. The default value
157
- is <literal>off</literal>.
158
- </para>
159
-
160
- <para>
161
- It is safe to use <literal>off</literal> for logical replication:
162
- If the subscriber loses transactions because of missing
163
- synchronization, the data will be sent again from the publisher.
164
- </para>
174
+ <para>
175
+ The following parameters control the replication behavior:
165
176
166
- <para>
167
- A different setting might be appropriate when doing synchronous
168
- logical replication. The logical replication workers report the
169
- positions of writes and flushes to the publisher, and when using
170
- synchronous replication, the publisher will wait for the actual
171
- flush. This means that setting
172
- <literal>synchronous_commit</literal> for the subscriber to
173
- <literal>off</literal> when the subscription is used for
174
- synchronous replication might increase the latency for
175
- <command>COMMIT</command> on the publisher. In this scenario, it
176
- can be advantageous to set <literal>synchronous_commit</literal>
177
- to <literal>local</literal> or higher.
178
- </para>
179
- </listitem>
180
- </varlistentry>
177
+ <variablelist>
181
178
182
179
<varlistentry>
183
180
<term><literal>binary</literal> (<type>boolean</type>)</term>
@@ -201,33 +198,16 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
201
198
</varlistentry>
202
199
203
200
<varlistentry>
204
- <term><literal>connect </literal> (<type>boolean</type>)</term>
201
+ <term><literal>copy_data </literal> (<type>boolean</type>)</term>
205
202
<listitem>
206
203
<para>
207
- Specifies whether the <command>CREATE SUBSCRIPTION</command>
208
- should connect to the publisher at all. Setting this to
209
- <literal>false</literal> will change default values of
210
- <literal>enabled</literal>, <literal>create_slot</literal> and
211
- <literal>copy_data</literal> to <literal>false</literal>.
212
- </para>
213
-
214
- <para>
215
- It is not allowed to combine <literal>connect</literal> set to
216
- <literal>false</literal> and <literal>enabled</literal>,
217
- <literal>create_slot</literal>, or <literal>copy_data</literal>
218
- set to <literal>true</literal>.
219
- </para>
220
-
221
- <para>
222
- Since no connection is made when this option is set
223
- to <literal>false</literal>, the tables are not subscribed, and so
224
- after you enable the subscription nothing will be replicated.
225
- It is required to run
226
- <literal>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</literal> in order
227
- for tables to be subscribed.
204
+ Specifies whether the existing data in the publications that are
205
+ being subscribed to should be copied once the replication starts.
206
+ The default is <literal>true</literal>.
228
207
</para>
229
208
</listitem>
230
209
</varlistentry>
210
+
231
211
<varlistentry>
232
212
<term><literal>streaming</literal> (<type>boolean</type>)</term>
233
213
<listitem>
@@ -237,9 +217,41 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
237
217
are fully decoded on the publisher, and only then sent to the
238
218
subscriber as a whole.
239
219
</para>
220
+ </listitem>
221
+ </varlistentry>
222
+
223
+ <varlistentry>
224
+ <term><literal>synchronous_commit</literal> (<type>enum</type>)</term>
225
+ <listitem>
226
+ <para>
227
+ The value of this parameter overrides the
228
+ <xref linkend="guc-synchronous-commit"/> setting within this
229
+ subscription's apply worker processes. The default value
230
+ is <literal>off</literal>.
231
+ </para>
232
+
233
+ <para>
234
+ It is safe to use <literal>off</literal> for logical replication:
235
+ If the subscriber loses transactions because of missing
236
+ synchronization, the data will be sent again from the publisher.
237
+ </para>
240
238
239
+ <para>
240
+ A different setting might be appropriate when doing synchronous
241
+ logical replication. The logical replication workers report the
242
+ positions of writes and flushes to the publisher, and when using
243
+ synchronous replication, the publisher will wait for the actual
244
+ flush. This means that setting
245
+ <literal>synchronous_commit</literal> for the subscriber to
246
+ <literal>off</literal> when the subscription is used for
247
+ synchronous replication might increase the latency for
248
+ <command>COMMIT</command> on the publisher. In this scenario, it
249
+ can be advantageous to set <literal>synchronous_commit</literal>
250
+ to <literal>local</literal> or higher.
251
+ </para>
241
252
</listitem>
242
253
</varlistentry>
254
+
243
255
<varlistentry>
244
256
<term><literal>two_phase</literal> (<type>boolean</type>)</term>
245
257
<listitem>
@@ -266,7 +278,9 @@ CREATE SUBSCRIPTION <replaceable class="parameter">subscription_name</replaceabl
266
278
267
279
</listitem>
268
280
</varlistentry>
269
- </variablelist></para>
281
+ </variablelist>
282
+ </para>
283
+
270
284
</listitem>
271
285
</varlistentry>
272
286
</variablelist>
0 commit comments