> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/internals/catalogs/catalog-pg-subscription.md).

# 52.54. pg\_subscription \#

The catalog `pg_subscription` contains all existing logical replication subscriptions. For more information about logical replication see [Chapter 29](/server-administration/logical-replication.md).

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.54. `pg_subscription` Columns**

| <p>Column Type</p><p>Description</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>oid</code> <code>oid</code></p><p>Row identifier</p>                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><code>subdbid</code> <code>oid</code> (references <a href="/pages/tFeixuXBQN9SLDszXFq9"><code>pg\_database</code></a>.<code>oid</code>)</p><p>OID of the database that the subscription resides in</p>                                                                                                                                                                                                                                                                                                   |
| <p><code>subskiplsn</code> <code>pg\_lsn</code></p><p>Finish LSN of the transaction whose changes are to be skipped, if a valid LSN; otherwise <code>0/0</code>.</p>                                                                                                                                                                                                                                                                                                                                        |
| <p><code>subname</code> <code>name</code></p><p>Name of the subscription</p>                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><code>subowner</code> <code>oid</code> (references <a href="/pages/nyEMOe5gQKgypFQTDbjS"><code>pg\_authid</code></a>.<code>oid</code>)</p><p>Owner of the subscription</p>                                                                                                                                                                                                                                                                                                                               |
| <p><code>subenabled</code> <code>bool</code></p><p>If true, the subscription is enabled and should be replicating</p>                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><code>subbinary</code> <code>bool</code></p><p>If true, the subscription will request that the publisher send data in binary format</p>                                                                                                                                                                                                                                                                                                                                                                  |
| <p><code>substream</code> <code>char</code></p><p>Controls how to handle the streaming of in-progress transactions: <code>f</code> = disallow streaming of in-progress transactions, <code>t</code> = spill the changes of in-progress transactions to disk and apply at once after the transaction is committed on the publisher and received by the subscriber, <code>p</code> = apply changes directly using a parallel apply worker if available (same as <code>t</code> if no worker is available)</p> |
| <p><code>subtwophasestate</code> <code>char</code></p><p>State codes for two-phase mode: <code>d</code> = disabled, <code>p</code> = pending enablement, <code>e</code> = enabled</p>                                                                                                                                                                                                                                                                                                                       |
| <p><code>subdisableonerr</code> <code>bool</code></p><p>If true, the subscription will be disabled if one of its workers detects an error</p>                                                                                                                                                                                                                                                                                                                                                               |
| <p><code>subpasswordrequired</code> <code>bool</code></p><p>If true, the subscription will be required to specify a password for authentication</p>                                                                                                                                                                                                                                                                                                                                                         |
| <p><code>subrunasowner</code> <code>bool</code></p><p>If true, the subscription will be run with the permissions of the subscription owner</p>                                                                                                                                                                                                                                                                                                                                                              |
| <p><code>subfailover</code> <code>bool</code></p><p>If true, the associated replication slots (i.e. the main slot and the table synchronization slots) in the upstream database are enabled to be synchronized to the standbys</p>                                                                                                                                                                                                                                                                          |
| <p><code>subconninfo</code> <code>text</code></p><p>Connection string to the upstream database</p>                                                                                                                                                                                                                                                                                                                                                                                                          |
| <p><code>subslotname</code> <code>name</code></p><p>Name of the replication slot in the upstream database (also used for the local replication origin name); null represents <code>NONE</code></p>                                                                                                                                                                                                                                                                                                          |
| <p><code>subsynccommit</code> <code>text</code></p><p>The <code>synchronous\_commit</code> setting for the subscription's workers to use</p>                                                                                                                                                                                                                                                                                                                                                                |
| <p><code>subpublications</code> <code>text\[]</code></p><p>Array of subscribed publication names. These reference publications defined in the upstream database. For more on publications see <a href="/pages/Vm9xr4wVV2bMufGE2YS9">Section 29.1</a>.</p>                                                                                                                                                                                                                                                   |
| <p><code>suborigin</code> <code>text</code></p><p>The origin value must be either <code>none</code> or <code>any</code>. The default is <code>any</code>. If <code>none</code>, the subscription will request the publisher to only send changes that don't have an origin. If <code>any</code>, the publisher sends changes regardless of their origin.</p>                                                                                                                                                |

<br>

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/catalog-pg-subscription.html)（英文原文，待翻譯）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.postgresql.tw/internals/catalogs/catalog-pg-subscription.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
