title: How can I update all rows in Postgresql from 1 to N, where N number of rows?
body: <p>Find this example <a href="https://stackoverflow.com/a/13629639/947111">https://stackoverflow.com/a/13629639/947111</a> but it's for sqlserver while I need it for Postgresql. </p>
  
  <p>For example my <code>table</code> has the following structure:</p>
  
  <pre><code>id|title|slot_id
  ----------------
  1 |    1|     1
  2 |    2|     1
  3 |    3|     1
  4 |    1|     2
  5 |    2|     2
  </code></pre>
  
  <p>When I delete row from the middle of set (set defined by <code>slot_id</code>), for example 1,2,3 where <code>slot_id</code> = 1 and row with title = 2 was removed I need to perform renaming so it won't 1,3 but 1,2</p>