title: Postgres - Copy (Stripped Double Quotes)
body: <p>I am using Postgres 8.4.4 copy, <a href="http://www.postgresql.org/docs/8.4/static/sql-copy.html" rel="noreferrer">http://www.postgresql.org/docs/8.4/static/sql-copy.html</a>,  to import CSV data into my database.  Some of the values in my source data contain double-quotes which are getting stripped upon insertion whereas when I do an INSERT or UPDATE statement via psql for testing the double-quotes are retained.  Maybe giving a clue as to what is going on, some values also contain commas which are retained as needed.</p>
  
  <p>I have attempted to resolve the issue base on info in <a href="http://www.postgresql.org/docs/8.3/interactive/sql-syntax-lexical.html" rel="noreferrer">http://www.postgresql.org/docs/8.3/interactive/sql-syntax-lexical.html</a> but have had no success.</p>
  
  <p>The copy command I'm using is:</p>
  
  <pre><code>copy my_table (field_1, field_2, field_3 ...) from '/tmp/source.csv' with csv
  </code></pre>
  
  <p>The source data is double-quoted with comma separator. This can be changed if necessary...</p>
  
  <p>"value","another value","this is "another" value","no more, thanks"</p>