PGXC_LOCK_CONFLICTS

PGXC_LOCK_CONFLICTS displays information about conflicting locks in the cluster.

When a lock is waiting for another lock or another lock is waiting for this one, a lock conflict occurs.

Currently, PGXC_LOCK_CONFLICTS collects only information about locks whose locktype is relation, partition, page, tuple, or transactionid.

Table 1 PGXC_LOCK_CONFLICTS columns

Name

Type

Description

locktype

text

Type of the locked object

nodename

name

Name of the node where the locked object resides

dbname

name

Name of the database where the locked object resides. The value is NULL if the locked object is a transaction.

nspname

name

Name of the namespace of the locked object

relname

name

Name of the relation targeted by the lock. The value is NULL if the object is not a relation or part of a relation.

partname

name

Name of the partition targeted by the lock. The value is NULL if the locked object is not a partition.

page

integer

Number of the page targeted by the lock. The value is NULL if the locked object is neither a page nor a tuple.

tuple

smallint

Number of the tuple targeted by the lock. The value is NULL if the locked object is not a tuple.

transactionid

xid

ID of the transaction targeted by the lock. The value is NULL if the locked object is not a transaction.

username

name

Name of the user who applies for the lock

gxid

xid

ID of the transaction that applies for the lock

xactstart

timestamp with time zone

Start time of the transaction that applies for the lock

queryid

bigint

Latest query ID of the thread that applies for the lock

query

text

Latest query statement of the thread that applies for the lock

pid

bigint

ID of the thread that applies for the lock

mode

text

Lock mode

granted

boolean

  • TRUE if the lock has been held

  • FALSE if the lock is still waiting for another lock