PG_LWLOCKS
PG_LWLOCKS provides information on lightweight locks currently held or being waited for by the current instance. This view is supported only by 9.1.0.200 and later cluster versions.
Name |
Type |
Description |
---|---|---|
pid |
bigint |
ID of the backend thread. |
query_id |
bigint |
ID of a query. |
lwtid |
integer |
Lightweight thread ID of the backend thread. |
reqlockid |
integer |
ID of the lightweight lock that is being requested by the current thread. |
reqlock |
text |
Name of the lightweight lock corresponding to reqlockid. |
heldlocknums |
integer |
Number of lightweight locks obtained by the current thread. |
heldlockid |
integer |
Lightweight lock ID obtained by the current thread. |
heldlock |
text |
Name of the lightweight lock corresponding to heldlockid. |
heldlockmode |
text |
Lightweight lock mode corresponding to heldlockid. |
Example
1 2 3 4 5 6 |
SELECT * FROM pg_lwlocks; pid | query_id | lwtid | reqlockid | reqlock | heldlocknums | heldlockid | heldlock | heldlockmode -----------------+-------------------+-------+-----------+---------+--------------+------------+--------------------+-------------- 139810224192480 | 0 | 54842 | | | 1 | 7 | WALWriteLock | Exclusive 139810224199520 | 78250043526306022 | 54963 | | | 1 | 193860 | BUFFER_POOL_LWLOCK | Exclusive (2 rows) |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.