PostgreSQL & Databases
Row locks
UPDATE acquires row-level locks and concurrent writers can wait behind the transaction.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A command to try yourself
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in PostgreSQL & Databases
- Tuple visibilityBeginner · 4 min
PostgreSQL MVCC lets transactions see row versions according to snapshots and isolation semantics. Updates create new row versions; VACUUM eventually reclaims obsolete…
- Isolation levelsBeginner · 4 min
READ COMMITTED takes a fresh snapshot per statement; REPEATABLE READ retains a stable snapshot for the transaction.
- DeadlocksBeginner · 4 min
PostgreSQL detects deadlock cycles and aborts one transaction to break the cycle.
- B-tree index selectivityBeginner · 4 min
The planner compares index access cost against a sequential scan using table statistics.
- EXPLAIN ANALYZEBeginner · 4 min
EXPLAIN (ANALYZE, BUFFERS) runs the query and reports actual plan timing and buffer usage.
- HOT updatesBeginner · 4 min
Heap-only tuple updates can avoid secondary index churn when indexed columns stay unchanged and room exists on the page.