Is it possible in Postgres 9.6 to get on duplicate key
UPSERT functionality using the COPY
command? I have a CSV file that I'm importing into Postgres, but it may contain some duplicate key violations, so the COPY
command gives an error and terminates when it encounters them.
The file is very large so it might not be possible to pre-process it in application code (in order to handle rows that might lead to duplicate key violations) since all keys might not fit into memory.
What's the best way to import a very large number of rows into Postgres that might contain duplicate key violations?