Hacker News new | ask | show | jobs
by dakridge 4501 days ago
I'm sorry, I only just started learning SQL a few days ago... But I was building a simple web application and I wanted to add a user if the email didn't exist else update that user's fields. And I came across this article: http://www.the-art-of-web.com/sql/upsert/

Is that not an upsert?

1 comments

If you read the whole page, you see that it still requires a full table lock to avoid duplicates. A true upsert would not require a table lock.