PostgreSQL, explained for people who build and operate real systems

Concurrency · Practical field guide

Make concurrent writes behave predictably.

Understand transactions, isolation, and locking through practical examples, so concurrent activity stops feeling mysterious and starts becoming debuggable.

  • ACID in practice
  • Isolation levels
  • Deadlock investigation

Secure checkout via Digistore24 · Digital delivery

Clear mental modelsPractical SQL examplesProduction-aware decisions

01 / What you'll learn

From guessing to understanding.

Build a mental model you can use at the keyboard, during a review, and when production asks a difficult question.

01

Reason about transactions

Connect BEGIN, COMMIT, and ROLLBACK to visibility, atomicity, and the boundaries in your application.

02

Choose an isolation level

Compare read committed, repeatable read, and serializable using the anomalies each level prevents.

03

Find what is blocking

Inspect lock activity and waiting sessions, then trace a blocked statement back to its transaction.

04

Prevent deadlocks

Recognize lock-ordering problems and design transactions that are shorter, clearer, and easier to retry.

PostgreSQL in context

Find the lock behind the wait.

Learn to inspect activity without jumping straight to termination. Identify waiting statements, blocking sessions, and the transactions involved.

example.sql
SELECT blocked.pid,
       blocker.pid AS blocking_pid,
       blocked.query AS waiting_query
FROM pg_stat_activity blocked
JOIN pg_stat_activity blocker
  ON blocker.pid = ANY(pg_blocking_pids(blocked.pid))
WHERE cardinality(pg_blocking_pids(blocked.pid)) > 0;

02 / Inside the manual

A clear path through the details.

Move from core mechanics to practical decisions, with examples that connect the SQL to the reason behind it.

01

The transaction contract

Explore atomic changes, savepoints, visibility, and why transaction scope belongs in application design.

02

Locks and isolation, made visible

Follow concurrent sessions through row locks, table locks, snapshots, and common isolation anomalies.

03

Diagnose contention without panic

Work through blocking and deadlock examples, then apply patterns that reduce lock duration and conflict.

03 / Who it's for

Made for the person behind the query.

Useful when you know the basics and want to understand what happens next.

  • Developers writing concurrent workflows
  • Engineers debugging intermittent waits
  • Teams handling financial, inventory, or booking updates

A manual to keep within reach

Read sequentially. Return selectively.

Use the guide as a learning path now and a practical reference later.

  • Follow the concepts in a deliberate order
  • Run and adapt the SQL examples
  • Revisit individual patterns when you need them

04 / Questions, answered

Before you dive in.

A few useful details about this guide and the purchase process.

Will this help with intermittent production slowdowns?

It gives you a systematic way to inspect blocking and understand lock behavior. The examples focus on diagnosis and safer transaction design rather than one-off fixes.

What format is the manual?

This is a digital learning resource. After checkout, Digistore24 provides the access instructions associated with your purchase.

How do I receive my purchase?

Complete your order through the secure Digistore24 checkout. Delivery and access details are shown during checkout and sent using the email address you provide.

Volume 03 · Concurrency

Ready to make PostgreSQL feel clearer?

Get Transactions, Locks & Concurrency and put the examples to work in your next database session.

Get this volume

Secure checkout via Digistore24 · Digital delivery