pg_stat_subscription — PostgreSQL statistics view

The PostgreSQL pg_stat_subscription statistics view: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

pg_stat_subscription is a PostgreSQL statistics view. Its columns are documented below; see the linked PostgreSQL documentation for the full narrative description.

Columns

The pg_stat_subscription statistics view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • subid oid
    OID of the subscription
  • subname name
    Name of the subscription
  • worker_type text
    Type of the subscription worker process. Possible types are apply, parallel apply, table synchronization, and sequence synchronization.
  • pid integer
    Process ID of the subscription worker process
  • leader_pid integer
    Process ID of the leader apply worker if this process is a parallel apply worker; NULL if this process is a leader apply worker or a table synchronization worker
  • relid oid
    OID of the relation that the worker is synchronizing; NULL for the leader apply worker and parallel apply workers
  • received_lsn pg_lsn
    Last write-ahead log location received, the initial value of this field being 0; NULL for parallel apply workers
  • last_msg_send_time timestamp with time zone
    Send time of last message received from origin WAL sender; NULL for parallel apply workers
  • last_msg_receipt_time timestamp with time zone
    Receipt time of last message received from origin WAL sender; NULL for parallel apply workers
  • latest_end_lsn pg_lsn
    Last write-ahead log location reported to origin WAL sender; NULL for parallel apply workers
  • latest_end_time timestamp with time zone
    Time of last write-ahead log location reported to origin WAL sender; NULL for parallel apply workers

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_stat_subscription.