52.52. pg_subscription

В каталоге pg_subscription содержатся все существующие подписки логической репликации. Подробнее логическая репликация описана в Главе 31.

В отличие от большинства системных каталогов, pg_subscription разделяется всеми базами данных кластера: есть только один экземпляр pg_subscription в кластере, а не отдельные в каждой базе данных.

Обычные пользователи не имеют доступа к столбцу subconninfo, так как он может содержать пароль в открытом виде.

Таблица 52.52. Столбцы pg_subscription

ИмяТипСсылкиОписание
oidoid Идентификатор строки (скрытый атрибут; должен выбираться явно)
subdbidoidpg_database.oidOID базы данных, в которой располагается эта подписка
subnamename Имя подписки
subowneroidpg_authid.oidВладелец подписки
subenabledbool Если true, подписка включена и должна реплицироваться.
subsynccommittext Содержит значение параметра synchronous_commit для рабочих процессов подписки.
subconninfotext Строка подключения к вышестоящей базе данных
subslotnamename Имя слота репликации в вышестоящей базе данных (также применяется в качестве локального имени источника репликации); значение null соответствует имени NONE
subpublicationstext[] Массив имён публикаций, на которые оформлена подписка. Подписки с этими именами должны быть опубликованы на сервере. Подробнее публикации описаны в Разделе 31.1.

52.52. 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 52.52. pg_subscription Columns

NameTypeReferencesDescription
oidoid Row identifier (hidden attribute; must be explicitly selected)
subdbidoidpg_database.oidOID of the database which the subscription resides in
subnamename Name of the subscription
subowneroidpg_authid.oidOwner of the subscription
subenabledbool If true, the subscription is enabled and should be replicating.
subsynccommittext  Contains the value of the synchronous_commit setting for the subscription workers.
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
subpublicationstext[] Array of subscribed publication names. These reference the publications on the publisher server. For more on publications see Section 31.1.