53.54. pg_subscription

The catalog pg_subscription contains all existing logical replication subscriptions. For more information about logical replication see Chapter 31.

Unlike most system catalogs, pg_subscription is shared across all databases of a cluster: there is only one copy of pg_subscription per cluster, not one per database.

Access to the column subconninfo is revoked from normal users, because it could contain plain-text passwords.

Table 53.54. pg_subscription Columns

Column Type

Description

oidoid

Row identifier

subdbidoid (references pg_database.oid)

OID of the database that the subscription resides in

subskiplsnpg_lsn

Finish LSN of the transaction whose changes are to be skipped, if a valid LSN; otherwise 0/0.

subnamename

Name of the subscription

subowneroid (references pg_authid.oid)

Owner of the subscription

subenabledbool

If true, the subscription is enabled and should be replicating

subbinarybool

If true, the subscription will request that the publisher send data in binary format

substreambool

If true, the subscription will allow streaming of in-progress transactions

subtwophasestatechar

State codes for two-phase mode: d = disabled, p = pending enablement, e = enabled

subdisableonerrbool

If true, the subscription will be disabled if one of its workers detects an error

subconninfotext

Connection string to the upstream database

subslotnamename

Name of the replication slot in the upstream database (also used for the local replication origin name); null represents NONE

subsynccommittext

The synchronous_commit setting for the subscription's workers to use

subpublicationstext[]

Array of subscribed publication names. These reference publications defined in the upstream database. For more on publications see Section 31.1.


close