Skip to content

Commit bb85eec

Browse files
committed
CREATE PUBLICATION ref: Minor tweaks to row filters
Prompted by a complaint from Justin Pryzby. Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/20220414003301.GT26620@telsasoft.com
1 parent 40eba06 commit bb85eec

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

doc/src/sgml/ref/create_publication.sgml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
7979
</para>
8080

8181
<para>
82-
If the optional <literal>WHERE</literal> clause is specified, rows for
82+
If the optional <literal>WHERE</literal> clause is specified, it defines a
83+
<firstterm>row filter</firstterm> expression. Rows for
8384
which the <replaceable class="parameter">expression</replaceable>
8485
evaluates to false or null will not be published. Note that parentheses
8586
are required around the expression. It has no effect on
@@ -192,6 +193,11 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
192193
consisting of a different set of partitions.
193194
</para>
194195

196+
<para>
197+
This parameter also affects how row filters and column lists are
198+
chosen for partitions; see below for details.
199+
</para>
200+
195201
<para>
196202
If this is enabled, <literal>TRUNCATE</literal> operations performed
197203
directly on partitions are not replicated.
@@ -241,21 +247,28 @@ CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
241247
</para>
242248

243249
<para>
244-
A <literal>WHERE</literal> (i.e. row filter) expression must contain only
250+
A row filter expression (i.e., the <literal>WHERE</literal> clause) must contain only
245251
columns that are covered by the <literal>REPLICA IDENTITY</literal>, in
246252
order for <command>UPDATE</command> and <command>DELETE</command> operations
247253
to be published. For publication of <command>INSERT</command> operations,
248254
any column may be used in the <literal>WHERE</literal> expression. The
249-
<literal>WHERE</literal> clause allows simple expressions that don't have
255+
row filter allows simple expressions that don't have
250256
user-defined functions, user-defined operators, user-defined types,
251257
user-defined collations, non-immutable built-in functions, or references to
252258
system columns.
253-
If your publication contains a partitioned table, the publication parameter
254-
<literal>publish_via_partition_root</literal> determines if it uses the
255-
partition's row filter (if the parameter is false, the default) or the root
256-
partitioned table's row filter.
259+
</para>
260+
261+
<para>
262+
For published partitioned tables, the row filter for each
263+
partition is taken from the published partitioned table if the
264+
publication parameter <literal>publish_via_partition_root</literal> is true,
265+
or from the partition itself if it is false (the default).
257266
See <xref linkend="logical-replication-row-filter"/> for details about row
258267
filters.
268+
Similarly, for published partitioned tables, the column list for each
269+
partition is taken from the published partitioned table if the
270+
publication parameter <literal>publish_via_partition_root</literal> is true,
271+
or from the partition itself if it is false.
259272
</para>
260273

261274
<para>

0 commit comments

Comments
 (0)