OK, thanks. But what with the second question in which the UPDATE is
based on a SELECT max(...) statement on another table? How can I ensure
that no other process inserts a row between my SELECT max() and UPDATE -
making my SELECT max() invalid?
A table lock could be an option but I am only interested in blocking for
row insertions for this particular account_id. Insertions for other
account_ids will not make the SELECT max() invalid and should therefore
be allowed.