title: How to save Amazon Redshift output to local CSV through SQL Workbench?
body: <p>I am writing psql through Amazon Redshift and now I am trying to save the output as CSV through PSQL query, on SQL Workbench
  The reason I am planning to do this through query instead of using <code>select</code> clause and then right click to save the output as csv, is because there are large amount of data, I found that if I generate the output into a temp table, it's much much faster than using <code>select</code> to display all the output. Therefore, I am thinking whether saving to local CSV can be faster too.</p>
  
  <p>I have tried the top solution <a href="https://stackoverflow.com/questions/1517635/save-pl-pgsql-output-from-postgresql-to-a-csv-file">here</a>, however, it doesn't work on Amazon Redshift, When I am using <code>Copy (SELECT col1, col2 FROM my_table) TO '[my local csv path]' WITH CSV DELIMITER ',';</code>, or tried <code>\Copy</code>, it kept showing me </p>
  
  <blockquote>
    <p>Amazon Invalid operation: syntax error at or near "("</p>
  </blockquote>
  
  <p>or </p>
  
  <blockquote>
    <p>Amazon Invalid operation: syntax error at or near "\" </p>
  </blockquote>
  
  <p>Then I have checked <a href="http://docs.aws.amazon.com/redshift/latest/dg/c_SQL_commands.html" rel="nofollow noreferrer">Amazon Redshift query tutorial</a>, didn't find any clause that could save the output to local CSV. It seems that <code>COPY</code> is to copy data from an Amazon data source to Redshift, <code>UNLOAD</code> is to save data to s3, but I just want to save the data on my local machine.</p>
  
  <p>So, is there any way to save the <strong>Redshift output</strong> to my <strong>local CSV</strong>  but with SQL Workbench?</p>