Home Explore Blog CI



postgresql

6th chunk of `doc/src/sgml/ref/alter_subscription.sgml`
fcef8aa02be1ad7007ee6d37e69a0264e6f9693ff57ac88d0000000100000861
 (parameters: subscription <parameter>oid</parameter>, remote transaction id <parameter>xid</parameter>).
      To resolve such transactions manually, you need to roll back all
      the prepared transactions with corresponding subscription IDs in their
      names. Applications can check
      <link linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link>
      to find the required prepared transactions. After the <literal>two_phase</literal>
      option is changed from <literal>true</literal> to <literal>false</literal>,
      the publisher will replicate the transactions again when they are committed.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry id="sql-altersubscription-params-skip">
    <term><literal>SKIP ( <replaceable class="parameter">skip_option</replaceable> = <replaceable class="parameter">value</replaceable> )</literal></term>
    <listitem>
     <para>
      Skips applying all changes of the remote transaction.  If incoming data
      violates any constraints, logical replication will stop until it is
      resolved.  By using the <command>ALTER SUBSCRIPTION ... SKIP</command> command,
      the logical replication worker skips all data modification changes within
      the transaction.  This option has no effect on the transactions that are
      already prepared by enabling
      <link linkend="sql-createsubscription-params-with-two-phase"><literal>two_phase</literal></link>
      on the subscriber.
      After the logical replication worker successfully skips the transaction or
      finishes a transaction, the LSN (stored in
      <structname>pg_subscription</structname>.<structfield>subskiplsn</structfield>)
      is cleared.  See <xref linkend="logical-replication-conflicts"/> for
      the details of logical replication conflicts.
     </para>

     <para>
      <replaceable>skip_option</replaceable> specifies options for this operation.
      The supported option is:

      <variablelist>
       <varlistentry>
        <term><literal>lsn</literal> (<type>pg_lsn</type>)</term>
        <listitem>
         <para>
          Specifies the finish

Title: ALTER SUBSCRIPTION Parameters: Skipping Transactions (SKIP)
Summary
This section describes the SKIP clause in ALTER SUBSCRIPTION, used to bypass applying changes from a remote transaction, particularly when constraint violations cause replication to halt. It explains that SKIP has no effect on prepared transactions when two_phase is enabled and that the subskiplsn is cleared after a successful skip or transaction completion. It also describes the lsn skip option, specifying the transaction's finish LSN.