title: Regenerate ids of existing records
body: <p>I have a Rails app with a custom algorithm for <code>id</code> generation for one table. Now I decided to use default incremental ids generated by Postgres as primary keys and move my custom values from <code>id</code> to another column like <code>uid</code>. And I want to regenerate values in <code>id</code> column for all records - as normal from 1 to n.<br>
  What is the best way to do this? I have about 1000 records. Records from other tables are associated with these records.</p>