Course map
Stage 1: Foundation
Stage 2: Intermediate
Stage 3: Advanced
Stage 4: Performance & internals
Stage 5: Specialization

Part 15 / Topic 1 of 7

Process architecture

PostgreSQL is a family of operating-system processes, not threads. The postmaster listens on the port; every connection gets its own backend process; a crew of background workers (checkpointer, autovacuum, WAL writer…) keeps house. Ask your own connection who it is:

SELECT pg_backend_pid() AS my_backend;  -- output varies per run
 my_backend 
------------
      81321
(1 row)

That number is a real OS process id — ps would show it. You met the roster in Part 12's deadlock DETAIL ("Process 77495 waits for…"): those were two backends negotiating. Practical consequences of one-process-per-connection: each connection costs real memory (why connection pooling exists — Stage 5B), and one backend crashing can't scribble over another's memory. pg_stat_activity — your Part 12 acquaintance — is simply the live list of these processes.

🧪 Quick quiz — answer from memory, then check.

  1. What does each client connection get?
  2. Why do busy applications pool connections?
Show the answers
  1. Its own backend process, child of the postmaster.
  2. Processes are expensive to start and hold memory — a pool reuses a few backends for many clients.

Done here? The practice set for Part 15 — 5 exercises with solutions — is on the part page.

Search the guide