0

I'm looking for a good way to bulk "upsert" a csv. The table is:

category_id (indexed but not unique)      post_id (indexed and unique)

a post_id should only be represented once.

Is there a good way to do this?

To do a bulk insert I've used the COPY posts FROM 'posts.csv' CSV; in psql, but I've never done a bulk "where exists update, else insert" type of operation.

Satwik Nadkarny
  • 5,086
  • 2
  • 23
  • 41
mgoldwasser
  • 14,558
  • 15
  • 79
  • 103

0 Answers0