title: PostgreSQL 9.1 primary key autoincrement
body: <p>I'm trying to add a primary key with an autoincrement.</p>
  <p>I have read some docs and other questions - there're <code>SERIAL</code> and <code>nextval()</code> statements but neither of them work.</p>
  <p>Here's what I made:</p>
  <pre><code>CREATE TABLE IF NOT EXISTS &quot;category&quot; (
    &quot;id&quot; integer SERIAL PRIMARY KEY,
    &quot;name&quot; varchar(30) DEFAULT NULL
  ); // the error near &quot;SERIAL&quot;
  </code></pre>
  <p>and</p>
  <pre><code>CREATE SEQUENCE your_seq;
  CREATE TABLE IF NOT EXISTS &quot;category&quot; (
    &quot;id&quot; integer PRIMARY KEY nextval('your_seq'),
    &quot;name&quot; varchar(30) DEFAULT NULL
  ); // the error near 'nextval'
  </code></pre>
  <p>What am I doing wrong? Is there a way to increment the primary key by 1.</p>