I have always used pg_bulkload. It's a bit of pain to compile but the tool is really fast... I love how you can define what to do with constraint conflicts, etc.
Recently I used it to bulk import a billion rows and dedupe by a single column/constraint by throwing out the rows that conflicted. It did it-- in like two hours.
Recently I used it to bulk import a billion rows and dedupe by a single column/constraint by throwing out the rows that conflicted. It did it-- in like two hours.
see: https://ossc-db.github.io/pg_bulkload/pg_bulkload.html