title: Compact or renumber IDs for all tables, and reset sequences to max(id)?
body: <p>After running for a long time, I get more and more holes in the id field. Some tables' id are int32, and the id sequence is reaching its maximum value. Some of the Java sources are read-only, so I cannot simply change the id column type from <code>int32</code> to <code>long</code>, which would break the API.</p>
  
  <p>I'd like to renumber them all. This may be not good practice, but good or bad is not concerned in this question. I want to renumber, especially, those very long IDs like "61789238", "548273826529524324". I don't know why they are so long, but shorter IDs are also easier to handle manually.</p>
  
  <p>But it's not easy to compact IDs by hand because of references and constraints.</p>
  
  <p>Does PostgreSQL itself support of ID renumbering? Or is there any plugin or maintaining utility for this job? </p>
  
  <p>Maybe I can write some stored procedures? That would be very nice so I can schedule it once a year.</p>