Per documentation , by default it has SELECT ... FOR UPDATE .
A SELECT ... FOR UPDATE in a row does not block other row reads. It only blocks other sessions from getting a FOR UPDATE (write) or FOR SHARE (read) lock on a row. The string remains normally readable for sessions that perform SELECT without any FOR UPDATE or FOR SHARE .
So, in this case you will need to find line, then do lock('FOR SHARE') if you want to make sure that someone else does not have a FOR UPDATE lock.
For more information, see the PostgreSQL documentation on explicit locking .
source share