PostgreSQL — How to UPSERT safely, easily and fast
Prevent duplicates, insert new records, updated existing ones
Published in
4 min readOct 12, 2021
When you UPSERT data into a table, you update or ignore records that already exist and insert new ones. After reading this article, you’ll be able to perform a single query in Postgres that allows you to do exactly this. We’ll go through a practical example that demonstrates…