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.