A Table Lock Cannot Refresh a Snapshot
@prranitarora▲ 11 net votes
In PostgreSQL REPEATABLE READ, a LOCK TABLE acquired after the first query can wait for concurrent writers to finish, but it cannot refresh the transaction's already-frozen snapshot. Subsequent reads may still show pre-commit values. Acquire the table lock before the first query if the snapshot must be taken only after current writers finish.