title: Escaping delimiter in Amazon Redshift COPY command
body: <p>I'm pulling data from Amazon S3 into a table in Amazon Redshift. The table contains various columns, where some column data might contain special characters.</p>
  
  <p>The copy command has an option called <code>Delimiter</code> where we can specify the delimiter while pulling the data into the table.</p>
  
  <p>The issue is 2 fold - </p>
  
  <p>When I export <code>(unload command)</code> to S3 using a delimiter - say <code>,</code> - it works fine, but when I try to import into Redshift from S3, the issue creeps in because certain columns contain the ',' operator which the copy command misinterprets as delimiter and throws error.</p>
  
  <p>I tried various delimiters, but the data in my table seems to contain some or other kind of special character which causes the above issue.</p>
  
  <p>I even tried unloading using multiple delimiter - like <code>#%</code> or <code>~,</code> but when loading from s3 using copy command - the dual delimiter is not supported.</p>
  
  <p>Any solutions?</p>
  
  <p>I think the delimiter can be escaped using <code>\</code> but for some reason that isn't working either, or maybe I'm not using the right syntax for escaping in copy command.</p>