title: How do I ALTER a PostgreSQL table and make a column unique?
body: <p>I have a table in PostgreSQL where the schema looks like this:</p>
  <pre><code>CREATE TABLE &quot;foo_table&quot; (
      &quot;id&quot; serial NOT NULL PRIMARY KEY,
      &quot;permalink&quot; varchar(200) NOT NULL,
      &quot;text&quot; varchar(512) NOT NULL,
      &quot;timestamp&quot; timestamp with time zone NOT NULL
  )
  </code></pre>
  <p>Now I want to make the permalink unique across the table by <code>ALTER</code>-ing the table.</p>