Home Explore Blog CI



postgresql

1st chunk of `doc/src/sgml/pgrowlocks.sgml`
9ded838e8f9d579e447d66544d00c7e7fe4fa71dfb77089b00000001000008c1
<!-- doc/src/sgml/pgrowlocks.sgml -->

<sect1 id="pgrowlocks" xreflabel="pgrowlocks">
 <title>pgrowlocks &mdash; show a table's row locking information</title>

 <indexterm zone="pgrowlocks">
  <primary>pgrowlocks</primary>
 </indexterm>

 <para>
  The <filename>pgrowlocks</filename> module provides a function to show row
  locking information for a specified table.
 </para>

 <para>
  By default use is restricted to superusers, roles with privileges of the
  <literal>pg_stat_scan_tables</literal> role, and users with
  <literal>SELECT</literal> permissions on the table.
 </para>


 <sect2 id="pgrowlocks-overview">
  <title>Overview</title>

  <indexterm>
   <primary>pgrowlocks</primary>
  </indexterm>

<synopsis>
pgrowlocks(text) returns setof record
</synopsis>

  <para>
   The parameter is the name of a table.  The result is a set of records,
   with one row for each locked row within the table.  The output columns
   are shown in <xref linkend="pgrowlocks-columns"/>.
  </para>

  <table id="pgrowlocks-columns">
   <title><function>pgrowlocks</function> Output Columns</title>

   <tgroup cols="3">
    <thead>
     <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
     </row>
    </thead>
    <tbody>

     <row>
      <entry><structfield>locked_row</structfield></entry>
      <entry><type>tid</type></entry>
      <entry>Tuple ID (TID) of locked row</entry>
     </row>
     <row>
      <entry><structfield>locker</structfield></entry>
      <entry><type>xid</type></entry>
      <entry>Transaction ID of locker, or multixact ID if
      multitransaction;  see <xref linkend="transaction-id"/></entry>
     </row>
     <row>
      <entry><structfield>multi</structfield></entry>
      <entry><type>boolean</type></entry>
      <entry>True if locker is a multitransaction</entry>
     </row>
     <row>
      <entry><structfield>xids</structfield></entry>
      <entry><type>xid[]</type></entry>
      <entry>Transaction IDs of lockers (more than one if multitransaction)</entry>
     </row>
     <row>
      <entry><structfield>modes</structfield></entry>
      <entry><type>text[]</type></entry>
      <entry>Lock mode of lockers (more than one if multitransaction),
       an

Title: pgrowlocks: Show Table Row Locking Information
Summary
The pgrowlocks module provides a function to display row locking information for a specified table, with restricted access to superusers and roles with certain privileges, and returns a set of records with details about each locked row.