PG_LOCKS
PG_LOCKS displays information about locks held by open transactions. In the multi-tenancy scenario, PDB data is returned only to its own PDB, and global data is returned to a non-PDB.
Name |
Type |
Reference |
Description |
---|---|---|---|
locktype |
text |
- |
Type of the locked object. The value can be relation, extend, page, tuple, transactionid, virtualxid, object, userlock, advisory, or tablespace. |
database |
oid |
OID in PG_DATABASE |
OID of the database in which the locked target exists.
|
relation |
oid |
OID in PG_CLASS |
OID of the relationship targeted by the lock (NULL if the object is not a relation or part of a relation). |
page |
integer |
- |
Page number targeted by the lock within the relation (NULL if the object is not a relation page or row page). |
tuple |
smallint |
- |
Row number targeted by the lock within the page (NULL if the object is not a row). |
bucket |
integer |
- |
Bucket number corresponding to the child table. The value is NULL if the target is not a table. |
virtualxid |
text |
- |
ID of the virtual transaction The value is NULL if the object is not a virtual transaction. |
transactionid |
xid |
- |
ID of the transaction. The value is NULL if the object is not a transaction. |
classid |
oid |
OID in PG_CLASS |
OID of the system catalog that contains the object (NULL if the object is not a general database object) |
objid |
oid |
- |
OID of the lock target within its system catalog (NULL if the target is not a general database object). |
objsubid |
smallint |
- |
Column number for a column in the table (0 if the object is of other object type and NULL if the object is not a general database object) |
virtualtransaction |
text |
- |
ID of the virtual transaction holding or awaiting this lock. |
pid |
bigint |
- |
ID of the server logic thread that holds or waits for the lock. (NULL if the lock is held by a prepared transaction) |
sessionid |
bigint |
- |
ID of the session that holds or waits for the lock. |
mode |
text |
- |
Lock mode held or desired by this thread The value can be AccessShareLock, RowShareLock, RowExclusiveLock, ShareLock, ShareRowExclusiveLock, ExclusiveLock, or AccessExclusiveLock. |
granted |
Boolean |
- |
|
fastpath |
Boolean |
- |
The value is TRUE if the lock is obtained through fast-path, and is FALSE if the lock is obtained through the main lock table. |
locktag |
text |
- |
Lock information that the session waits for. It can be parsed using the locktag_decode() function. |
global_sessionid |
text |
- |
Global session ID |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.