バージョンごとのドキュメント一覧

74.2. トランザクションとロック #

<title>Transactions and Locking</title>

The transaction IDs of currently executing transactions are shown in <link linkend="view-pg-locks"><structname>pg_locks</structname></link> in columns <structfield>virtualxid</structfield> and <structfield>transactionid</structfield>. Read-only transactions will have <structfield>virtualxid</structfield>s but NULL <structfield>transactionid</structfield>s, while both columns will be set in read-write transactions. 現在実行中のトランザクションのトランザクションIDは、pg_locksvirtualxidtransactionidに表示されます。 読み出し専用のトランザクションはvirtualxidはありますが、transactionidはNULLです。 一方、読み書きのトランザクションは、両方の列が設定されます。

Some lock types wait on <structfield>virtualxid</structfield>, while other types wait on <structfield>transactionid</structfield>. Row-level read and write locks are recorded directly in the locked rows and can be inspected using the <xref linkend="pgrowlocks"/> extension. Row-level read locks might also require the assignment of multixact IDs (<literal>mxid</literal>; see <xref linkend="vacuum-for-multixact-wraparound"/>). ロックのタイプによってvirtualxidを待ちますが、他のタイプのロックはtransactionidを待ちます。 行レベルの読み書きロックはロックされた行に直接記録され、pgrowlocks拡張を使用して検査できます。 行レベルの読み取りロックはマルチトランザクションID(mxid25.1.5.1を参照)の割当ても必要とするかもしれません。