title: Select For Update statement in PostgreSql
body: <p>I want to select fields in a record of a table and update just one of these fields. How can I do?</p>
  <p>I try this:</p>
  <pre><code>SELECT v.idvideo, v.title 
  FROM video v  WHERE v.schedulingflag IS FALSE AND v.errorflag IS FALSE 
  ORDER BY v.idvideo  LIMIT 1 FOR UPDATE ;
  
  UPDATE video  SET schedulingflag = true;
  </code></pre>
  <p>But in this way it sets field &quot;schedulingflag&quot; true in all record!</p>