title: PostgreSQL - properly change ID of table row
body: <p>How to change id of some table's row?</p>
  
  <p>Like:</p>
  
  <pre><code>UPDATE table SET id=10 WHERE id=5;
  </code></pre>
  
  <p>But in way that it would cascade changes to every other table that references this table with that id?</p>
  
  <p>I want to do this, because I need to import data from another database which has most of the same tables, but ids are different. So if ids would match old database, it would be easier to import data correctly.</p>