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

# F.31. pgrowlocks — 顯示資料表的資料列鎖定資訊 \#

### F.31. pgrowlocks — 顯示資料表的資料列鎖定資訊 [#](#pgrowlocks) <a href="#pgrowlocks" id="pgrowlocks"></a>

[F.31.1. 概觀](https://docs.postgresql.tw/19/appendixes/contrib/pgrowlocks/pgrowlocks-overview.md#pgrowlocks-overview)

[F.31.2. 輸出範例](#pgrowlocks-sample-output)

[F.31.3. 作者](#pgrowlocks-author)

`pgrowlocks` 模組提供一個函式，用來顯示指定資料表的資料列鎖定資訊。

預設情況下，只有超級使用者、具有 `pg_stat_scan_tables` 角色權限的角色，以及對該資料表具有 `SELECT` 權限的使用者可以使用。

#### F.31.1. 概觀 [#](#pgrowlocks-overview) <a href="#pgrowlocks-overview" id="pgrowlocks-overview"></a>

完整內容請見 [F.31.1. 概觀](https://docs.postgresql.tw/19/appendixes/contrib/pgrowlocks/pgrowlocks-overview.md#pgrowlocks-overview)。

#### F.31.2. 輸出範例 [#](#pgrowlocks-sample-output) <a href="#pgrowlocks-sample-output" id="pgrowlocks-sample-output"></a>

```

=# SELECT * FROM pgrowlocks('t1');
 locked_row | locker | multi | xids  |     modes      |  pids
------------+--------+-------+-------+----------------+--------
 (0,1)      |    609 | f     | {609} | {"For Share"}  | {3161}
 (0,2)      |    609 | f     | {609} | {"For Share"}  | {3161}
 (0,3)      |    607 | f     | {607} | {"For Update"} | {3107}
 (0,4)      |    607 | f     | {607} | {"For Update"} | {3107}
(4 rows)
```

#### F.31.3. 作者 [#](#pgrowlocks-author) <a href="#pgrowlocks-author" id="pgrowlocks-author"></a>

Tatsuo Ishii

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/pgrowlocks.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/appendixes/contrib/pgrowlocks.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.
