3 ms·
This does not handle concurrent inserts though unless you rerun the code on unique violation.
by jeltz 13y ago
This does not handle concurrent inserts though unless you rerun the code on unique violation.
- np422 13y agoCorrect, but if I write the upsert in that way - I actually understand what I'm doing... :) If this is standard upsert query in your app, you should turn it into a procedure and parameterize, catch exceptions anyway. Or you could mess around with transaction isolation.