title: Select query with lock not working
body: <p>I am trying to read a row from a table with a lock so that others can not do any read operation on that table.</p>
  
  <p>Here is my query that I am running from the <code>psql</code> console with a <code>30 seconds</code> of sleep.</p>
  
  <pre><code>select * from TABLE_NAME for update; SELECT pg_sleep(30);
  </code></pre>
  
  <p>I also tried <code>nowait</code>:</p>
  
  <pre><code>select * from TABLE_NAME for update nowait; SELECT pg_sleep(30);
  </code></pre>
  
  <p>My table has <code>only one row</code> for the test purpose, so where condition is not required here.</p>
  
  <p>Now, from another <code>psql</code> console I am doing a <code>select</code> operation on the same table(within  the 30 seconds), but I am still able to read the records.</p>
  
  <p>My question is, why this locking is not working? Or Its not the right way to do it? Can someone guide me a bit?</p>