title: Error on using copy Command in Postgres (ERROR: invalid input syntax for type date: "")
body: <p>I have a CSV file from which I am trying to use Postgres <code>COPY</code> command in order to populate a table from that CSV file. One of the table columns <code>NEXT_VISIT</code> is of a date data_type. Some of the corresponding fields in the CSV file which are supposed to go into this date column have null values.</p>
  
  <p>The Copy command am running is like so:</p>
  
  <pre><code>COPY "VISIT_STAGING_TABLE" from E'C:\\Users\\Sir Codealot\\Desktop\\rufijihdss-2007-2010\\rufijihdss\\VISIT_TEST.CSV' CSV HEADER 
  </code></pre>
  
  <p>When I run this command I get the error:</p>
  
  <pre><code>ERROR:  invalid input syntax for type date: ""
  CONTEXT:  COPY VISIT_STAGING_TABLE, line 2, column NEXT_VISIT: ""
  
  ********** Error **********
  ERROR: invalid input syntax for type date: ""
  SQL state: 22007
  Context: COPY VISIT_STAGING_TABLE, line 2, column NEXT_VISIT: ""
  </code></pre>
  
  <p>How can I run the copy command and get Postgres to accept that some of the fields in the CSV file corresponding to <code>NEXT_VISIT</code> have values <code>""</code>?</p>