Locks (database) v1

Description

The page provides information on all transactions which are holding and/or requesting locks, and the locks they hold and/or are requesting, where those locks are in the current database.

Where this page is for the current database, it will also show locks on system tables, and as such the query which generates this page where it issues a number of locks, will always have some rows present in the output.

Columns

Name Type
object:schema_id int8
object:schema varchar
object:type varchar
object:id int8
object:name varchar
owner_user_id int4
owner varchar
transaction:pid int4
transaction:xid int8
transaction:start timestamp
transaction:duration interval
lock:type varchar
lock:state varchar

Column Descriptions

object:schema_id

The schema ID. This column is emitted in CSV exports only.

object:schema

The schema name.

object:type

Set to table or view.

object:id

The ID of the locked object. This is column emitted in CSV exports only.

object:name

The name of the locked object.

owner_user_id

The owner user ID. This column is emitted in CSV exports only.

owner

The owner user name.

transaction:pid

The process ID.

When a user connects to the cluster, a process is spawned, which accepts that connection. That’s the process the ID is for. That process is also the process which issues queries, and when you need to cancel a query, you in fact cancel the process, which by being cancelled, inherently also cancels the query it is running.

transaction:xid

The transaction ID.

transaction:start

Transaction start timestamp.

transaction:duration

Transaction duration.

Note this is an interval, not an int4.

lock:type

Lock Type Description
AccessExclusiveLock Blocks AccessShareLock and ShareRowExclusiveLock locks
AccessShareLock Blocks AccessExclusiveLock locks
ShareRowExclusiveLock Blocks other ShareRowExclusiveLock locks

lock:state

Set to held or pending.