PG_LOCKS
PG_LOCKS displays information about locks held by open transactions.
Table 1 PG_LOCKS columns
| Type of the locked object: relation, extend, page, tuple, transactionid, virtualxid, object, userlock, and advisory | |||
| OID in PG_DATABASE | OID of the database in which the locked target exists | ||
| 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 number targeted by the lock within the relation (NULL if the object is not a relation page or row page) | |||
| Row number targeted by the lock within the page (NULL if the object is not a row) | |||
| Bucket number corresponding to the child table. The value is NULL if the target is not a table. | |||
| Virtual ID of the transaction targeted by the lock (NULL if the object is not a virtual transaction) | |||
| ID of the transaction targeted by the lock (NULL if the object is not a transaction) | |||
| OID in PG_CLASS | OID of the system catalog that contains the object (NULL if the object is not a general database object) | ||
| OID of the lock target within its system table (NULL if the target is not a general database object) | |||
| 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) | |||
| Logical ID of the server thread holding or awaiting this lock (NULL if the lock is held by a prepared transaction) | |||
| 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. | |||
| Lock information that the session waits for. It can be parsed using the locktag_decode() function. | |||