4 ms·
The upsert strategy mentioned (using ON CONFLICT to update instead of insert) has a catch, if your PK is a sequence it will increment even though the insert has
by boarnoah 5y ago
The upsert strategy mentioned (using ON CONFLICT to update instead of insert) has a catch, if your PK is a sequence it will increment even though the insert has failed.
It's not a huge deal in most cases, is a bigger issue if you are running any sort of scheduled ETL to update (or insert new) things.
- orangepanda 5y agoDoes it matter? In case of rollbacks, the sequence would increment too. You have to handle gaps anyway.