title: PG COPY error: invalid input syntax for integer
body: <p>Running <a href="http://www.postgresql.org/docs/9.2/static/sql-copy.html" rel="noreferrer"><code>COPY</code></a> results in <strong><code>ERROR:  invalid input syntax for integer: ""</code></strong> error message for me. What am I missing?</p>
  
  <p>My <code>/tmp/people.csv</code> file:</p>
  
  <pre><code>"age","first_name","last_name"
  "23","Ivan","Poupkine"
  "","Eugene","Pirogov"
  </code></pre>
  
  <p>My <code>/tmp/csv_test.sql</code> file:</p>
  
  <pre><code>CREATE TABLE people (
    age        integer,
    first_name varchar(20),
    last_name  varchar(20)
  );
  
  COPY people
  FROM '/tmp/people.csv'
  WITH (
    FORMAT CSV,
    HEADER true,
    NULL ''
  );
  
  DROP TABLE people;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>$ psql postgres -f /tmp/sql_test.sql
  CREATE TABLE
  psql:sql_test.sql:13: ERROR:  invalid input syntax for integer: ""
  CONTEXT:  COPY people, line 3, column age: ""
  DROP TABLE
  </code></pre>
  
  <p>Trivia:</p>
  
  <ul>
  <li>PostgreSQL 9.2.4</li>
  </ul>