title: Copy multiple CSV files into postgres with incrementing id
body: <p>I have multiple CSV files and I am getting new ones every day. The Data from each file should be added to the postgres DB regularly. The Problem is that every CSV file has a column with id. So when adding the second file</p>
  <pre><code>COPY public.&quot;ERROR&quot; FROM 'C:\CSV\error.csv' DELIMITER ',' CSV HEADER;
  </code></pre>
  <p>I already get the error:</p>
  <pre><code>ERROR:  duplicate key value violates unique constraint &quot;ERROR_pkey&quot;
  DETAIL:  Key (id)=(0) already exists.
  KONTEXT:  COPY ERROR, line 2
  </code></pre>
  <p>However, in the DB I still need an id column as primary-key so I cannot just drop it. Is there a way to have an incrementing id   automatically generated?</p>
  <p>For example, like this.</p>
  <pre><code>CSV File 1:                        CSV File 2:
  id  error           value          id   error           value
  0   engine          10             0    engine          22
  1   lamp_dashboard  15             1    door_left       13
  2   door_left       17             2    indicator_left  37
  3   boot            8              3    indicator_right 65
  4   front_wheel     13             4    cockpit         16
  
  Data in DB:
  id  error           value
  0   engine          10
  1   lamp_dashboard  15 
  2   door_left       17
  3   boot            8
  4   front_wheel     13
  5   engine          22
  6   door_left       13
  7   indicator_left  37
  8   indicator_right 65
  9   cockpit         16 
  
  
  </code></pre>