Forum OpenACS Q&A: Response to This is a little off topic, its a nstcl question

Marc, keep in mind that with your "select to see if the row exists
yet" method, technically, you need to lock the whole table first.
Otherwise, your select could say "no, there is no such row", then
another user could insert that row, and then when you try to insert
that row it will fail.

This same issue exists with when using db_resultrows also, of course,
so yeah, this new SQL "merge" operation does sound useful, as it would
presumably do the "insert or update" all in one atomic operation,
without having to either explicitly lock the table first, or catch the
failure of the insert.