title: How to copy files to postgresql db from a csv file without duplicate data?
body: <p>i am using python code with psycopg2 to automate the process of downloading csv files from a website and copying to database but i need a way that does not allow duplicate data persistence, what would be the best way around this situation?</p>
  <p>i am currently using this code to copy:</p>
  <pre><code>COPY table_name(item ,order ,cn_main,cn_second)
                  FROM '{dir.get_cn_folder()}'
                  DELIMITER ';'
                  CSV HEADER encoding 'ISO-8859-1'; 
  </code></pre>