Home Explore Blog CI



postgresql

8th chunk of `doc/src/sgml/ref/create_subscription.sgml`
1961057721383f6408bcce0848c736c3db787d677711c3b7000000010000094d
 <literal>false</literal> or <literal>NULL</literal> will not be
   published. If the subscription has
   several publications in which the same table has been published with
   different <literal>WHERE</literal> clauses, a row will be published if any
   of the expressions (referring to that publish operation) are satisfied. In
   the case of different <literal>WHERE</literal> clauses, if one of the
   publications has no <literal>WHERE</literal> clause (referring to that
   publish operation) or the publication is declared as
   <link linkend="sql-createpublication-params-for-all-tables"><literal>FOR ALL TABLES</literal></link>
   or <link linkend="sql-createpublication-params-for-tables-in-schema"><literal>FOR TABLES IN SCHEMA</literal></link>,
   rows are always published regardless of the definition of the other
   expressions. If the subscriber is a <productname>PostgreSQL</productname>
   version before 15, then any row filtering is ignored during the initial data
   synchronization phase. For this case, the user might want to consider
   deleting any initially copied data that would be incompatible with
   subsequent filtering. Because initial data synchronization does not take
   into account the publication
   <link linkend="sql-createpublication-params-with-publish"><literal>publish</literal></link>
   parameter when copying existing table data, some rows may be copied that
   would not be replicated using DML. See
   <xref linkend="logical-replication-subscription-examples"/> for examples.
  </para>

  <para>
   Subscriptions having several publications in which the same table has been
   published with different column lists are not supported.
  </para>

  <para>
   We allow non-existent publications to be specified so that users can add
   those later. This means
   <link linkend="catalog-pg-subscription"><structname>pg_subscription</structname></link>
   can have non-existent publications.
  </para>

  <para>
   When using a subscription parameter combination of
   <literal>copy_data = true</literal> and <literal>origin = NONE</literal>,
   the initial sync table data is copied directly from the publisher, meaning
   that knowledge of the true origin of that data is not possible. If the
   publisher also has subscriptions then the copied table data might have
   originated from further upstream. This scenario is detected and

Title: CREATE SUBSCRIPTION Notes (Continued): WHERE Clauses, Column Lists, Non-Existent Publications, and Data Origin
Summary
This section continues the notes on `CREATE SUBSCRIPTION`, detailing how `WHERE` clauses in publications affect row filtering, especially with multiple publications and older PostgreSQL subscriber versions. It also mentions the incompatibility of subscriptions with different column lists for the same table, the allowance of specifying non-existent publications, and implications of using `copy_data = true` and `origin = NONE` with respect to data origin and potential upstream subscriptions.