Home Explore Blog CI



postgresql

95th chunk of `doc/src/sgml/catalogs.sgml`
5c2684718bd66e74d438318109f52d913d1d75299713a6ef0000000100000fa5
 of subscribed publication names. These reference
       publications defined in the upstream database. For more on publications
       see <xref linkend="logical-replication-publication"/>.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>suborigin</structfield> <type>text</type>
      </para>
      <para>
       The origin value must be either <literal>none</literal> or
       <literal>any</literal>. The default is <literal>any</literal>.
       If <literal>none</literal>, the subscription will request the publisher
       to only send changes that don't have an origin. If
       <literal>any</literal>, the publisher sends changes regardless of their
       origin.
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="catalog-pg-subscription-rel">
  <title><structname>pg_subscription_rel</structname></title>

  <indexterm zone="catalog-pg-subscription-rel">
   <primary>pg_subscription_rel</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_subscription_rel</structname> contains the
   state for each replicated relation in each subscription.  This is a
   many-to-many mapping.
  </para>

  <para>
   This catalog only contains tables known to the subscription after running
   either <link linkend="sql-createsubscription"><command>CREATE SUBSCRIPTION</command></link> or
   <link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION ... REFRESH
   PUBLICATION</command></link>.
  </para>

  <table>
   <title><structname>pg_subscription_rel</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>srsubid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-subscription"><structname>pg_subscription</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       Reference to subscription
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>srrelid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       Reference to relation
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>srsubstate</structfield> <type>char</type>
      </para>
      <para>
       State code:
       <literal>i</literal> = initialize,
       <literal>d</literal> = data is being copied,
       <literal>f</literal> = finished table copy,
       <literal>s</literal> = synchronized,
       <literal>r</literal> = ready (normal replication)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>srsublsn</structfield> <type>pg_lsn</type>
      </para>
      <para>
       Remote LSN of the state change used for synchronization coordination
       when in <literal>s</literal> or <literal>r</literal> states,
       otherwise null
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="catalog-pg-tablespace">
  <title><structname>pg_tablespace</structname></title>

  <indexterm zone="catalog-pg-tablespace">
   <primary>pg_tablespace</primary>
  </indexterm>

  <para>
   The catalog <structname>pg_tablespace</structname> stores information
   about the available tablespaces.  Tables can be placed in particular
   tablespaces to aid administration of disk layout.
  </para>

  <para>
   Unlike most system catalogs, <structname>pg_tablespace</structname>
   is shared

Title: pg_subscription_rel Catalog
Summary
This section describes the `pg_subscription_rel` catalog, which stores the state of each replicated relation within a subscription. It represents a many-to-many mapping between subscriptions and relations. The catalog includes details about the subscription ID (`srsubid`), the relation ID (`srrelid`), the replication state (`srsubstate`), and the remote LSN for synchronization (`srsublsn`).