pg_locks
The pg_locks view provides access to information about the locks held by open transactions within Greengage DB.
pg_locks contains one row per active lockable object, requested lock mode, and relevant transaction.
Thus, the same lockable object may appear many times if multiple transactions are holding or waiting for locks on it.
An object with no current locks on it will not appear in the view at all.
There are several distinct types of lockable objects: whole relations (such as tables), individual pages of relations, individual tuples of relations, transaction IDs (both virtual and permanent IDs), and general database objects. Also, the right to extend a relation is represented as a separate lockable object.
| Column | Type | References | Description |
|---|---|---|---|
locktype |
text |
— |
Type of the lockable object: |
database |
oid |
pg_database.oid |
OID of the database in which the object exists, |
relation |
oid |
pg_class.oid |
OID of the relation, or |
page |
integer |
— |
Page number within the relation, or |
tuple |
smallint |
— |
Tuple number within the page, or |
virtualxid |
text |
— |
Virtual ID of a transaction, or |
transactionid |
xid |
— |
ID of a transaction, or |
classid |
oid |
pg_class.oid |
OID of the system catalog containing the object, or |
objid |
oid |
any OID column |
OID of the object within its system catalog, or |
objsubid |
smallint |
— |
For a table column, this is the column number (the |
virtualtransaction |
text |
— |
Virtual ID of the transaction that is holding or awaiting this lock |
pid |
integer |
— |
Process ID of the server process holding or awaiting this lock.
|
mode |
text |
— |
Name of the lock mode held or desired by this process |
granted |
boolean |
— |
|
fastpath |
boolean |
— |
|
mppsessionid |
integer |
— |
The ID of the client session associated with this lock |
mppiswriter |
boolean |
— |
Specifies whether the lock is held by a writer process |
gp_segment_id |
integer |
— |
The content ID of the Greengage DB segment where the lock is held |