PostgreSQL in Practice

PostgreSQL Architecture

PostgreSQL 18 uses a process-per-connection server around shared memory, durable relation files, catalogs, and WAL. That architecture makes session count, cache behavior, checkpoints, and background maintenance application-visible operational concerns.
  • The postmaster accepts connections and supervises child processes.
  • Shared buffers mediate database-page access.
  • Catalogs are ordinary, transactionally visible relations.
  • Relation forks separate concerns.
  • WAL decouples commit durability from heap-page flushing.
  • Auxiliary processes protect liveness and operability.
Connection, cache, storage, and durability flow
Layer and consequence
LayerResponsibilityOperational consequence
Backendparse, plan, execute, session statepool sessions; avoid unbounded connection admission
Shared buffersshared page cache and dirty stateinspect workload and I/O before changing size
Relation files/forksheap, index, FSM, VM, unlogged initializationuse SQL/catalog tools, never manipulate files
WAL/checkpointdurability and restart frontierobserve WAL rate, checkpoint I/O, flush latency
Workersvacuum, archive, replication, parallel workreserve capacity and alert on stalled work
Inspect the running PostgreSQL 18 instance
SELECT version();
SELECT name, setting, unit, source, sourcefile
FROM pg_settings
WHERE name IN ('shared_buffers','max_connections','checkpoint_timeout');

SELECT backend_type, count(*)
FROM pg_stat_activity
GROUP BY backend_type ORDER BY backend_type;