title: "UNLOAD" data tables from AWS Redshift and make them readable as CSV
body: <p>I am currently trying to move several data tables in my current AWS instance's redshift database to a new database in a different AWS instance (for background my company has acquired a new one and we need to consolidate to on instance of AWS). </p>
  
  <p>I am using the UNLOAD command below on a table and I plan on making that table a csv then uploading that file to the destination AWS' S3 and using the COPY command to finish moving the table. </p>
  
  <pre><code>unload ('select * from table1')
  to 's3://destination_folder' 
  CREDENTIALS  'aws_access_key_id=XXXXXXXXXXXXX;aws_secret_access_key=XXXXXXXXX'
  ADDQUOTES
  DELIMITER AS ','
  PARALLEL OFF;
  </code></pre>
  
  <p>My issue is that when I change the file type to .csv and open the file I get inconsistencies with the data. there are areas where many rows are skipped and on some rows when the expected columns end I get additional columns with the value "f" for unknown reasons. Any help on how I could achieve this transfer would be greatly appreciated. </p>
  
  <p>EDIT 1: It looks like fields with quotes are having the quotes removed. Additionally fields with commas are having the commas separated away. I've identified some fields with quotes and commas and they are throwing everything off. Would the addquotes clause I have apply to the entire field regardless of whether there are quotes and commas within the field? </p>