@@ -367,7 +367,8 @@ INSERT 0 3
367
367
368
368
<para>
369
369
Create publications for the tables. The publications <literal>pub2</literal>
370
- and <literal>pub3a</literal> disallow some <literal>publish</literal>
370
+ and <literal>pub3a</literal> disallow some
371
+ <link linkend="sql-createpublication-with-publish"><literal>publish</literal></link>
371
372
operations. The publication <literal>pub3b</literal> has a row filter (see
372
373
<xref linkend="logical-replication-row-filter"/>).
373
374
<programlisting>
@@ -801,11 +802,12 @@ ALTER SUBSCRIPTION
801
802
802
803
<para>
803
804
If the publication contains a partitioned table, the publication parameter
804
- <literal>publish_via_partition_root</literal> determines which row filter
805
- is used. If <literal>publish_via_partition_root</literal> is <literal>true</literal>,
806
- the <emphasis>root partitioned table's</emphasis> row filter is used. Otherwise,
807
- if <literal>publish_via_partition_root</literal> is <literal>false</literal>
808
- (default), each <emphasis>partition's</emphasis> row filter is used.
805
+ <link linkend="sql-createpublication-with-publish-via-partition-root"><literal>publish_via_partition_root</literal></link>
806
+ determines which row filter is used. If <literal>publish_via_partition_root</literal>
807
+ is <literal>true</literal>, the <emphasis>root partitioned table's</emphasis>
808
+ row filter is used. Otherwise, if <literal>publish_via_partition_root</literal>
809
+ is <literal>false</literal> (default), each <emphasis>partition's</emphasis>
810
+ row filter is used.
809
811
</para>
810
812
811
813
</sect2>
@@ -829,8 +831,9 @@ ALTER SUBSCRIPTION
829
831
<warning>
830
832
<para>
831
833
Because initial data synchronization does not take into account the
832
- <literal>publish</literal> parameter when copying existing table data,
833
- some rows may be copied that would not be replicated using DML. Refer to
834
+ <link linkend="sql-createpublication-with-publish"><literal>publish</literal></link>
835
+ parameter when copying existing table data, some rows may be copied that
836
+ would not be replicated using DML. Refer to
834
837
<xref linkend="logical-replication-snapshot"/>, and see
835
838
<xref linkend="logical-replication-subscription-examples"/> for examples.
836
839
</para>
@@ -851,7 +854,8 @@ ALTER SUBSCRIPTION
851
854
852
855
<para>
853
856
If the subscription has several publications in which the same table has
854
- been published with different row filters (for the same <literal>publish</literal>
857
+ been published with different row filters (for the same
858
+ <link linkend="sql-createpublication-with-publish"><literal>publish</literal></link>
855
859
operation), those expressions get ORed together, so that rows satisfying
856
860
<emphasis>any</emphasis> of the expressions will be replicated. This means all
857
861
the other row filters for the same table become redundant if:
@@ -863,15 +867,17 @@ ALTER SUBSCRIPTION
863
867
</listitem>
864
868
<listitem>
865
869
<para>
866
- One of the publications was created using <literal>FOR ALL TABLES</literal>.
870
+ One of the publications was created using
871
+ <link linkend="sql-createpublication-for-all-tables"><literal>FOR ALL TABLES</literal></link>.
867
872
This clause does not allow row filters.
868
873
</para>
869
874
</listitem>
870
875
<listitem>
871
876
<para>
872
877
One of the publications was created using
873
- <literal>FOR TABLES IN SCHEMA</literal> and the table belongs to
874
- the referred schema. This clause does not allow row filters.
878
+ <link linkend="sql-createpublication-for-tables-in-schema"><literal>FOR TABLES IN SCHEMA</literal></link>
879
+ and the table belongs to the referred schema. This clause does not allow
880
+ row filters.
875
881
</para>
876
882
</listitem>
877
883
</itemizedlist></para>
@@ -1136,9 +1142,9 @@ test_sub=# SELECT * FROM t1;
1136
1142
1137
1143
<para>
1138
1144
The following examples show how the publication parameter
1139
- <literal>publish_via_partition_root</literal> determines whether the row
1140
- filter of the parent or child table will be used in the case of partitioned
1141
- tables.
1145
+ <link linkend="sql-createpublication-with-publish-via-partition-root">< literal>publish_via_partition_root</literal></link>
1146
+ determines whether the row filter of the parent or child table will be used
1147
+ in the case of partitioned tables.
1142
1148
</para>
1143
1149
1144
1150
<para>
@@ -1291,15 +1297,16 @@ test_sub=# SELECT * FROM child ORDER BY a;
1291
1297
1292
1298
<para>
1293
1299
Specifying a column list when the publication also publishes
1294
- <literal>FOR TABLES IN SCHEMA</literal> is not supported.
1300
+ <link linkend="sql-createpublication-for-tables-in-schema"><literal>FOR TABLES IN SCHEMA</literal></link>
1301
+ is not supported.
1295
1302
</para>
1296
1303
1297
1304
<para>
1298
1305
For partitioned tables, the publication parameter
1299
- <literal>publish_via_partition_root</literal> determines which column list
1300
- is used. If <literal>publish_via_partition_root</literal> is
1301
- <literal>true</literal>, the root partitioned table's column list is used.
1302
- Otherwise, if <literal>publish_via_partition_root</literal> is
1306
+ <link linkend="sql-createpublication-with-publish-via-partition-root">< literal>publish_via_partition_root</literal></link>
1307
+ determines which column list is used. If <literal>publish_via_partition_root</literal>
1308
+ is <literal>true</literal>, the root partitioned table's column list is
1309
+ used. Otherwise, if <literal>publish_via_partition_root</literal> is
1303
1310
<literal>false</literal> (the default), each partition's column list is used.
1304
1311
</para>
1305
1312
@@ -1610,7 +1617,9 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
1610
1617
tables.) Publications can also specify that changes are to be replicated
1611
1618
using the identity and schema of the partitioned root table instead of
1612
1619
that of the individual leaf partitions in which the changes actually
1613
- originate (see <link linkend="sql-createpublication"><command>CREATE PUBLICATION</command></link>).
1620
+ originate (see
1621
+ <link linkend="sql-createpublication-with-publish-via-partition-root"><literal>publish_via_partition_root</literal></link>
1622
+ parameter of <command>CREATE PUBLICATION</command>).
1614
1623
</para>
1615
1624
</listitem>
1616
1625
</itemizedlist>
@@ -1676,9 +1685,11 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
1676
1685
</para>
1677
1686
<note>
1678
1687
<para>
1679
- The publication <literal>publish</literal> parameter only affects what
1680
- DML operations will be replicated. The initial data synchronization does
1681
- not take this parameter into account when copying the existing table data.
1688
+ The publication
1689
+ <link linkend="sql-createpublication-with-publish"><literal>publish</literal></link>
1690
+ parameter only affects what DML operations will be replicated. The
1691
+ initial data synchronization does not take this parameter into account
1692
+ when copying the existing table data.
1682
1693
</para>
1683
1694
</note>
1684
1695
</sect2>
@@ -1724,10 +1735,11 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER
1724
1735
and <literal>TRIGGER</literal> privilege on such tables to trusted roles.
1725
1736
Moreover, if untrusted users can create tables, use only
1726
1737
publications that list tables explicitly. That is to say, create a
1727
- subscription <literal>FOR ALL TABLES</literal> or
1728
- <literal>FOR TABLES IN SCHEMA</literal> only when superusers trust
1729
- every user permitted to create a non-temp table on the publisher or the
1730
- subscriber.
1738
+ subscription
1739
+ <link linkend="sql-createpublication-for-all-tables"><literal>FOR ALL TABLES</literal></link>
1740
+ or <link linkend="sql-createpublication-for-tables-in-schema"><literal>FOR TABLES IN SCHEMA</literal></link>
1741
+ only when superusers trust every user permitted to create a non-temp table
1742
+ on the publisher or the subscriber.
1731
1743
</para>
1732
1744
1733
1745
<para>
0 commit comments