Upsert
Meaning in software engineering, with examples
In software engineering, upsert means: To insert a row if it does not exist yet, or update it if it already does, in a single operation. The word combines 'update' and 'insert'.
In Turkish: varsa güncelleyip yoksa eklemek, upsert etmek
How it is used
Also a noun: 'do an upsert'. Syntax differs: INSERT ... ON CONFLICT DO UPDATE in PostgreSQL and SQLite, INSERT ... ON DUPLICATE KEY UPDATE in MySQL, and MERGE in SQL Server and Oracle. It needs a unique key to decide whether the row exists.
Example sentences
The sync job upserts products by SKU, so running it twice is safe.
Use an upsert instead of checking first and then inserting; that check can race.
Common collocations
- upsert a row
- ON CONFLICT DO UPDATE
- MERGE statement
- upsert by key
Related terms
This word in other fields
The same English word can have a different meaning in another field:
More terms: Databases and Persistence
Practise with graded reading
Reading at the right level is the fastest way to make new words stick. Pick free English books by level:
