gp_locks_on_relation
The gp_toolkit.gp_locks_on_relation view shows locks currently being held on a relation, and associated session information about the query.
This view is accessible to all users.
However, non‑superusers will only be able to see the locks for relations that they have permission to access.
| Column | Description |
|---|---|
lorlocktype |
Type of the lockable object: |
lordatabase |
Object ID of the database in which the object exists; |
lorrelname |
The name of the relation |
lorrelation |
The object ID of the relation |
lortransaction |
The transaction ID that is affected by the lock |
lorpid |
Process ID of the server process holding or awaiting this lock.
|
lormode |
Name of the lock mode held or desired by this process |
lorgranted |
Displays whether the lock is granted ( |
lorcurrentquery |
The current query in the session |