title: How to use redshift copy command in psycopg2 identifier
body: <p>I set following python lambda code which execute <code>COPY</code> command to redshift.</p>
  <pre><code>bucket_name = get_bucket_name(event)
  file_name = get_file_name(event)
  
  table = bucket_name.replace('-','_')
  url = f's3://{bucket_name}/{file_name}'
  </code></pre>
  <pre><code>    query = sql.SQL(''' truncate test_Schema.{};
              commit;
              copy test_Schema.{}
              from {}
              iam_role 'arn:aws:iam::123344:role/test'
              timeformat as 'auto'
              ACCEPTINVCHARS
              CSV;''').format(*map(sql.Identifier,(table,table,url)))
      
      print(query)
      cur = con.cursor()
      cur.execute(query, (url,))
      con.commit()
      
  </code></pre>
  <p>By using identifier, I can use variables and set S3 bucket destination.</p>
  <p>But it returned following errors. it seems that double quotation caused error..</p>
  <pre><code>truncate test_Schema.&quot;test&quot;;
  commit;
  copy jp_icqa_ddl.&quot;operation_defect_detail&quot;
  from &quot;s3://test_Schema/test_20210816.csv&quot;
  iam_role 'arn:aws:iam::123344:role/test'
  timeformat as 'auto'
  ACCEPTINVCHARS
  CSV; 
  
  [ERROR] SyntaxError: syntax error at or near &quot;&quot;s3://test_Schema/test_20210816.csv&quot;&quot;
  LINE 4:             from &quot;s3://test_Schema/test_20210816...
                           ^
  
  Traceback (most recent call last):
    File &quot;/var/task/s3-to-redshift.py&quot;, line 63, in lambda_handler
      cur.execute(query, (url,))
  </code></pre>
  <p>Are there any way to avoid this ?</p>
  <p>How can I handle double quotation in identifier ?</p>
  <p>Thanks</p>