> 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/19/server-administration/monitoring/monitoring-stats/monitoring-pg-stat-subscription.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 27.2.8. pg\_stat\_subscription

## 27.2.8. `pg_stat_subscription` [#](#monitoring-pg-stat-subscription) <a href="#monitoring-pg-stat-subscription" id="monitoring-pg-stat-subscription"></a>

### 表 27.18. `pg_stat_subscription` 檢視表 [#](#pg-stat-subscription) <a href="#pg-stat-subscription" id="pg-stat-subscription"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                            |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>subid</code> <code>oid</code></p><p>此訂閱的 OID</p>                                                                                                       |
| <p><code>subname</code> <code>name</code></p><p>此訂閱的名稱</p>                                                                                                      |
| <p><code>worker\_type</code> <code>text</code></p><p>訂閱工作程序的類型。可能的類型有 <code>apply</code>、<code>parallel apply</code> 以及 <code>table synchronization</code>。</p> |
| <p><code>pid</code> <code>integer</code></p><p>訂閱工作程序的程序 ID</p>                                                                                                 |
| <p><code>leader\_pid</code> <code>integer</code></p><p>若此程序為平行套用工作程序，則為領導套用工作程序的程序 ID； 若此程序為領導套用工作程序或資料表同步 工作程序，則為 NULL</p>                                     |
| <p><code>relid</code> <code>oid</code></p><p>此工作程序正在同步之關聯的 OID；對於領導套用工作程序以及 平行套用工作程序，則為 NULL</p>                                                                |
| <p><code>received\_lsn</code> <code>pg\_lsn</code></p><p>最後接收到的預寫式日誌位置，此欄位的 初始值為 0；對於平行套用工作程序則為 NULL</p>                                                        |
| <p><code>last\_msg\_send\_time</code> <code>timestamp with time zone</code></p><p>從來源 WAL 傳送程序收到最後一則訊息的傳送時間；對於 平行套用工作程序則為 NULL</p>                              |
| <p><code>last\_msg\_receipt\_time</code> <code>timestamp with time zone</code></p><p>從來源 WAL 傳送程序收到最後一則訊息的接收時間；對於 平行套用工作程序則為 NULL</p>                           |
| <p><code>latest\_end\_lsn</code> <code>pg\_lsn</code></p><p>回報給來源 WAL 傳送程序的最後一個預寫式日誌位置；對於 平行套用工作程序則為 NULL</p>                                                   |
| <p><code>latest\_end\_time</code> <code>timestamp with time zone</code></p><p>回報給來源 WAL 傳送程序最後一個預寫式日誌位置的 時間；對於平行套用工作程序則為 NULL</p>                               |

<br>

[返回 27.2. 累計統計系統](https://docs.postgresql.tw/19/server-administration/monitoring/monitoring-stats.md#monitoring-stats)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/monitoring-stats.html)（原文版本：18.6；核對日期：2026-10-23）


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/server-administration/monitoring/monitoring-stats/monitoring-pg-stat-subscription.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
