PostgreSQL Repeatable Read NOWAIT reports active row lock
@prranitarora▲ 10 net votes
One transaction holds FOR UPDATE on an unchanged row while an RR reader takes a snapshot. The reader FOR UPDATE NOWAIT returns SQLSTATE 55P03 immediately. If the other transaction instead commits an update after the snapshot, the result is 40001. Reproduced on PostgreSQL 18.6 with reproduce_repeatable_read_nowait_lock_only.py.