> 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-database-conflicts-view.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 27.2.18. pg\_stat\_database\_conflicts

## 27.2.18. `pg_stat_database_conflicts` [#](#monitoring-pg-stat-database-conflicts-view) <a href="#monitoring-pg-stat-database-conflicts-view" id="monitoring-pg-stat-database-conflicts-view"></a>

`pg_stat_database_conflicts` 檢視表中，每個 資料庫都會有一筆資料列，顯示資料庫層級中，因與待命伺服器上復原作業 衝突而取消查詢的統計資訊。 由於主要伺服器上不會發生衝突，此檢視表僅會包含 待命伺服器上的資訊。

### 表 27.28. `pg_stat_database_conflicts` 檢視表 [#](#pg-stat-database-conflicts-view) <a href="#pg-stat-database-conflicts-view" id="pg-stat-database-conflicts-view"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                                                          |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>datid</code> <code>oid</code></p><p>某個資料庫的 OID</p>                                                                                                                                                                                   |
| <p><code>datname</code> <code>name</code></p><p>此資料庫的名稱</p>                                                                                                                                                                                   |
| <p><code>confl\_tablespace</code> <code>bigint</code></p><p>此資料庫中因資料表空間已被卸除（DROP）而取消的 查詢數量</p>                                                                                                                                                |
| <p><code>confl\_lock</code> <code>bigint</code></p><p>此資料庫中因鎖定逾時而取消的 查詢數量</p>                                                                                                                                                                 |
| <p><code>confl\_snapshot</code> <code>bigint</code></p><p>此資料庫中因過舊快照而取消的 查詢數量</p>                                                                                                                                                             |
| <p><code>confl\_bufferpin</code> <code>bigint</code></p><p>此資料庫中因緩衝區被釘選而取消的 查詢數量</p>                                                                                                                                                          |
| <p><code>confl\_deadlock</code> <code>bigint</code></p><p>此資料庫中因死結而取消的 查詢數量</p>                                                                                                                                                               |
| <p><code>confl\_active\_logicalslot</code> <code>bigint</code></p><p>此資料庫中因過舊快照，或主要伺服器上 <a href="https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-wal.md#GUC-WAL-LEVEL">wal\_level</a> 設定過低而取消的 邏輯插槽使用次數</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-database-conflicts-view.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.
