https://www.postgresql.org/docs/current/mvcc-intro.html
Asking because needing a lock for changing a row isn't the only approach that can be taken.