select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Supported versions: Current (18) / 17 / 16
Development versions: 19 / devel
Pre-release documentation. PostgreSQL 19 Beta 3 is a testing release. The final release may differ.

67.2. Transactions and Locking #

The transaction IDs of currently executing transactions are shown in pg_locks in columns virtualxid and transactionid. Read-only transactions will have virtualxids but NULL transactionids, while both columns will be set in read-write transactions.

Some lock types wait on virtualxid, while other types wait on transactionid. Row-level read and write locks are recorded directly in the locked rows and can be inspected using the pgrowlocks extension. Row-level read locks might also require the assignment of multixact IDs (mxid; see Section 24.1.5.1).

Report a documentation issue

Read the upstream documentation. For corrections, first check the current version.