pg_subscription_rel — PostgreSQL system catalog

The PostgreSQL pg_subscription_rel system catalog: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

The catalog pg_subscription_rel stores the state of each replicated table and sequence for each subscription. This is a many-to-many mapping.

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_subscription_rel system catalog exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • srsubid oid references pg_subscription.oid
    Reference to subscription
  • srrelid oid references pg_class.oid
    Reference to table or sequence
  • srsubstate char
    State code for the table or sequence. State codes for tables: i = initialize, d = data is being copied, f = finished table copy, s = synchronized, r = ready (normal replication) State codes for sequences: i = initialize, r = ready
  • srsublsn pg_lsn
    Remote LSN of the state change used for synchronization coordination when in s or r states, otherwise null

Related catalogs

This object references the following other system catalogs:

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_subscription_rel.