title: After importing data in PostgreSQL, duplicate key value violates unique constraint
body: <p>I recently migrated my rails app to PostgreSQL in order to take advantage of fulltext search.</p>
  
  <p>Since the migration coincided with moving to a new webhost, the steps for migration were:</p>
  
  <ol>
  <li>Deploy the application and db:create/db:schema:load on the new server, with appropriate database.yml file</li>
  <li>mysqldump data only from existing MySQL production database</li>
  <li>import data into PostgreSQL database</li>
  </ol>
  
  <p>The application is running successfully but the issue comes when trying to add new content to the database. For example, when I run the rake task to update my twitter feed:</p>
  
  <pre><code>PG::Error: ERROR:  duplicate key value violates unique constraint "twitter_feeds_pkey" DETAIL:  Key (id)=(3) already exists.
  </code></pre>
  
  <p>This also happens for all other models, creating new articles, users etc. In development I can see that posting the insert statement n+1 times will successfully save the record without error.</p>
  
  <p>My question is: <strong>How do I tell PostgreSQL to start adding indexes sequentially from the existing data?</strong></p>
  
  <p>I've read the <code>REINDEX</code> page but don't think that is really the operation I'm looking for. </p>