title: Postgres could not create unique index, key is duplicated
body: <p>I'm trying to add a column to a table in my Postgres 9.3 database with this seemingly simple SQL:</p>
  
  <pre><code>ALTER TABLE quizzes ADD COLUMN deleted BOOLEAN NOT NULL DEFAULT false;
  </code></pre>
  
  <p>However, I'm getting the following error:</p>
  
  <pre><code>ERROR:  could not create unique index "quizzes_pkey"
  DETAIL:  Key (id)=(10557462) is duplicated.
  </code></pre>
  
  <p>Strangely enough, there are actually <em>no rows</em> with that id (which is the primary key, so it shouldn't have duplicates):</p>
  
  <pre><code>SELECT id FROM quizzes WHERE id = 10557462;
   id 
  ----
  (0 rows)
  </code></pre>
  
  <p>In fact, it looks like that id has been skipped somehow:</p>
  
  <pre><code>SELECT id FROM quizzes WHERE id &gt; 10557459 ORDER BY id LIMIT 4;
      id    
  ----------
   10557460
   10557461
   10557463
   10557464
  (4 rows)
  </code></pre>
  
  <p>Why is this preventing me from adding a column, and how can I fix it?</p>