title: COPY with exclude clause "invalid byte sequence for encoding "UTF8": 0xdf 0x4f"
body: <p>I use COPY to import a file in my database</p>
  
  <pre><code>COPY mytable(c1, c2) FROM '/tmp/myfile.csv' WITH DELIMITER ';' CSV HEADER
  </code></pre>
  
  <p>And as usual, there are some "bad" caracters in the file wich generates encoding SQL error:</p>
  
  <pre><code>ERROR:  invalid byte sequence for encoding "UTF8": 0xdf 0x4f
  </code></pre>
  
  <p>So I open the file and delete the line but, is there a way to COPY a file excluding by default this kind of line ?</p>
  
  <p>Thanks for help</p>