title: How to list all locked rows of a table?
body: <p>My application uses pessimistic locking. When a user opens the form for update a record, the application executes this query (table names are exemplary):</p>
  
  <pre><code>begin;
  select * 
  from master m
  natural join detail d
  where m.master_id = 123456
  for update nowait;
  </code></pre>
  
  <p>The query locks one master row and several (to several dozen) detail rows. Transaction is open until a user confirms or cancels updates. </p>
  
  <p>I need to know what rows (at least master rows) are locked. I have excavated the documentation and postgres wiki without success.</p>
  
  <p>Is it possible to list all locked rows?</p>