Home Explore Blog CI



postgresql

19th chunk of `doc/src/sgml/system-views.sgml`
e1690254aa982d8d4d14c50cd29505260a943f9cbf5298170000000100000fa0
 relation targeted by the lock, or null if the target is not
       a relation or part of a relation
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>page</structfield> <type>int4</type>
      </para>
      <para>
       Page number targeted by the lock within the relation,
       or null if the target is not a relation page or tuple
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tuple</structfield> <type>int2</type>
      </para>
      <para>
       Tuple number targeted by the lock within the page,
       or null if the target is not a tuple
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>virtualxid</structfield> <type>text</type>
      </para>
      <para>
       Virtual ID of the transaction targeted by the lock,
       or null if the target is not a virtual transaction ID;  see
       <xref linkend="transactions"/>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>transactionid</structfield> <type>xid</type>
      </para>
      <para>
       ID of the transaction targeted by the lock, or null if the target
       is not a transaction ID;  <xref linkend="transactions"/>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>classid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       OID of the system catalog containing the lock target, or null if the
       target is not a general database object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objid</structfield> <type>oid</type>
       (references any OID column)
      </para>
      <para>
       OID of the lock target within its system catalog, or null if the
       target is not a general database object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>objsubid</structfield> <type>int2</type>
      </para>
      <para>
       Column number targeted by the lock (the
       <structfield>classid</structfield> and <structfield>objid</structfield> refer to the
       table itself),
       or zero if the target is some other general database object,
       or null if the target is not a general database object
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>virtualtransaction</structfield> <type>text</type>
      </para>
      <para>
       Virtual ID of the transaction that is holding or awaiting this lock
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>pid</structfield> <type>int4</type>
      </para>
      <para>
       Process ID of the server process holding or awaiting this
       lock, or null if the lock is held by a prepared transaction
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>mode</structfield> <type>text</type>
      </para>
      <para>
       Name of the lock mode held or desired by this process (see <xref linkend="locking-tables"/> and <xref linkend="xact-serializable"/>)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>granted</structfield> <type>bool</type>
      </para>
      <para>
       True if lock is held, false if lock is awaited
      </para></entry>

Title: pg_locks View Columns
Summary
The pg_locks view contains columns that provide detailed information about the locks held by active processes within the database server. These columns include the lock type, database, relation, page, tuple, virtual transaction ID, transaction ID, class ID, object ID, object subID, virtual transaction, process ID, lock mode, and granted status. Each column provides specific details about the lockable object and the lock being held, allowing for a comprehensive understanding of the locking mechanisms in the database server.