posted Jan 20, 2014, 12:54 PM by Sachchida Ojha
gpadmin=# \d gp_toolkit.gp_locks_on_resqueue
View "gp_toolkit.gp_locks_on_resqueue"
     Column     |  Type   | Modifiers 
 lorusename     | name    | 
 lorrsqname     | name    | 
 lorlocktype    | text    | 
 lorobjid       | oid     | 
 lortransaction | xid     | 
 lorpid         | integer | 
 lormode        | text    | 
 lorgranted     | boolean | 
 lorwaiting     | boolean | 
View definition:
 SELECT pgsa.usename AS lorusename, pgrq.rsqname AS lorrsqname, pgl.locktype AS lorlocktype, pgl.objid AS lorobjid, pgl.transaction AS lortransaction, AS lorpid, pgl.mode AS lormode, pgl.granted AS lorgranted, pgsa.waiting AS lorwaiting
   FROM pg_stat_activity pgsa
   JOIN pg_locks pgl ON pgsa.procpid =
   JOIN pg_resqueue pgrq ON pgl.objid = pgrq.oid;

lorusename=>Name of the user executing the session.
lorrsqname=>The resource queue name.
lorlocktype=>Type of the lockable object: resource queue
lorobjid=>The ID of the locked transaction.
lortransaction=>The ID of the transaction that is affected by the lock.
lorpid=>The process ID of the transaction that is affected by the lock.
lormode=>The name of the lock mode held or desired by this process.
lorgranted=>Displays whether the lock is granted (true) or not granted (false).
lorwaiting=>Displays whether or not the session is waiting.

This view shows any locks currently being held on a resource queue, and the associated session information about the query associated with the lock. This view is accessible to all users, however non-superusers will only be able to see the locks associated with their own sessions.

gpadmin=# select * from  gp_toolkit.gp_locks_on_resqueue;
 lorusename | lorrsqname | lorlocktype | lorobjid | lortransaction | lorpid | lormode | lorgranted | lorwaiting 
(0 rows)