title: Does Postgres guarantee to lock rows in the order of supplied update-statements?
body: <p>I like to do batch updates to Postgres. Sometimes, the batch may contain update-statements to the same record. (*) </p>
  
  <p>To this end I need to be sure that Postgres locks rows based on the order in which the update-statements are supplied. </p>
  
  <p>Is this guaranteed? </p>
  
  <p>To be clear, I'm sending a sequence of single row update-statements, so not a single multi-row update-statement. E.g.: </p>
  
  <pre><code>update A set x='abc', dt='&lt;timeN&gt;' where id='123'; 
  update A set x='def', dt='&lt;timeN+1&gt;' where id='123'; 
  update A set x='ghi', dt='&lt;timeN+2&gt;' where id='123'; 
  </code></pre>
  
  <p>*) This might seem redundant: just only save the last one. However, I have defined an after-trigger on the table so history is created in a different table. Therefore I need the multiple updates.</p>