Updated on 2024-06-03 GMT+08:00

GS_BUCKET_LOCKS

GS_BUCKET_LOCKS displays information about locks held by open transactions. Only CNs in distributed mode can be queried.

Table 1 GS_BUCKET_LOCKS columns

Name

Type

Reference

Description

node_name

text

-

Node name.

database

oid

OID in PG_DATABASE

OID of the database in which the locked target exists.

virtualtransaction

text

-

Virtual ID of the transaction holding or awaiting this lock.

pid

bigint

-

Logical ID of the server thread holding or awaiting this lock. The value is NULL if the lock is held by a prepared transaction.

sessionid

bigint

-

ID of the session that holds or waits for the lock.

mode

text

-

Lock mode held or desired by this thread.

The options are AccessShareLock and AccessExclusiveLock.

granted

boolean

-

  • The value is TRUE if the lock is a held lock.
  • The value is FALSE if the lock is an awaited lock.

fastpath

boolean

-

The value is TRUE if the lock is obtained through fast-path. The value is FALSE if the lock is obtained through library-level lock information or two-phase commit.

global_sessionid

text

-

Global session ID.

bucketlist

text

-

List of locked buckets.