title: psycopg2.DataError: invalid input syntax for type double precision: "NULL"
body: <p>I'm trying to upload a CSV file using the copy from command and the Python psycopg2 library. I understand that the error stems from trying to insert a char value into a double precision column, but I specified null values as <code>"NULL"</code> when creating my csv file and in the Postgres copy command I also specified nulls as <code>"NULL"</code>, so I'm not sure why it isn't converting those values when uploading.</p>
  
  <p><strong>Creating the csv file:</strong></p>
  
  <pre><code>with file_path.open(mode='w', newline='') as outfile:
      csv_writer = csv.writer(outfile, delimiter=delimiter, quoting=csv.QUOTE_NONNUMERIC)
  
      if include_headers:
          csv_writer.writerow(col[0] for col in self.cursor.description)
      for row in self.cursor:
          csv_writer.writerow(['NULL' if value is None else value for value in row])
  </code></pre>
  
  <p><strong>Uploading the file to postgres:</strong></p>
  
  <pre><code>sql = """COPY {table} FROM STDIN WITH (DELIMITER '{sep}', NULL 'NULL', FORMAT CSV, HEADER True);""".format(table=table, sep=sep)
  
  with open(file) as f:
      self.cursor.copy_expert(sql=sql, file=f, size=size)
  self.commit()
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>psycopg2.DataError: invalid input syntax for type double precision:
  "NULL" CONTEXT:  COPY test_table, line 25, column Lat:
  "NULL"
  </code></pre>