Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/create_publication.sgml`
d047aad9d1fa88cc74b58870286d7f8ee50e6a96a21be1320000000100000fa6
 If the optional <literal>WHERE</literal> clause is specified, it defines a
      <firstterm>row filter</firstterm> expression. Rows for
      which the <replaceable class="parameter">expression</replaceable>
      evaluates to false or null will not be published. Note that parentheses
      are required around the expression. It has no effect on
      <literal>TRUNCATE</literal> commands.
     </para>

     <para>
      When a column list is specified, only the named columns are replicated.
      The column list can contain stored generated columns as well. If the
      column list is omitted, the publication will replicate all non-generated
      columns (including any added in the future) by default. Stored generated
      columns can also be replicated if <literal>publish_generated_columns</literal>
      is set to <literal>stored</literal>. Specifying a column list has no
      effect on <literal>TRUNCATE</literal> commands. See
      <xref linkend="logical-replication-col-lists"/> for details about column
      lists.
     </para>

     <para>
      Only persistent base tables and partitioned tables can be part of a
      publication.  Temporary tables, unlogged tables, foreign tables,
      materialized views, and regular views cannot be part of a publication.
     </para>

     <para>
      Specifying a column list when the publication also publishes
      <literal>FOR TABLES IN SCHEMA</literal> is not supported.
     </para>

     <para>
      When a partitioned table is added to a publication, all of its existing
      and future partitions are implicitly considered to be part of the
      publication.  So, even operations that are performed directly on a
      partition are also published via publications that its ancestors are
      part of.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="sql-createpublication-params-for-all-tables">
    <term><literal>FOR ALL TABLES</literal></term>
    <listitem>
     <para>
      Marks the publication as one that replicates changes for all tables in
      the database, including tables created in the future.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="sql-createpublication-params-for-tables-in-schema">
    <term><literal>FOR TABLES IN SCHEMA</literal></term>
    <listitem>
     <para>
      Marks the publication as one that replicates changes for all tables in
      the specified list of schemas, including tables created in the future.
     </para>

     <para>
      Specifying a schema when the publication also publishes a table with a
      column list is not supported.
     </para>

     <para>
      Only persistent base tables and partitioned tables present in the schema
      will be included as part of the publication.  Temporary tables, unlogged
      tables, foreign tables, materialized views, and regular views from the
      schema will not be part of the publication.
     </para>

     <para>
      When a partitioned table is published via schema level publication, all
      of its existing and future partitions are implicitly considered to be part of the
      publication, regardless of whether they are from the publication schema or not.
      So, even operations that are performed directly on a
      partition are also published via publications that its ancestors are
      part of.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="sql-createpublication-params-with">
    <term><literal>WITH ( <replaceable class="parameter">publication_parameter</replaceable> [= <replaceable class="parameter">value</replaceable>] [, ... ] )</literal></term>
    <listitem>
     <para>
      This clause specifies optional parameters for a publication.  The
      following parameters are supported:

      <variablelist>
       <varlistentry id="sql-createpublication-params-with-publish">
        <term><literal>publish</literal> (<type>string</type>)</term>
        <listitem>
         <para>
          This parameter determines

Title: CREATE PUBLICATION Parameters: Row Filters, Column Lists, FOR ALL TABLES, and FOR TABLES IN SCHEMA
Summary
This section details the parameters for the CREATE PUBLICATION command, including the use of WHERE clauses to define row filters, column lists to specify replicated columns, and limitations on table types. It also covers FOR ALL TABLES (replicating all tables in the database) and FOR TABLES IN SCHEMA (replicating tables within specified schemas), including the handling of partitioned tables and restrictions on column lists.