Pessimistic vs Optimistic Locking in PostgreSQL

I learnt this the hard way. You don’t have to