Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This does not handle concurrent inserts though unless you rerun the code on unique violation.


Correct, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: