Postgres in practice: a tiny production playbook

July 5, 2025 (2mo ago)

Here are sensible defaults I reach for when spinning up a Postgres‑backed service.

Schema & types

Indexes

Migrations

-- Example: safe rename via new column
ALTER TABLE users ADD COLUMN full_name TEXT;
UPDATE users SET full_name = first_name || ' ' || last_name WHERE full_name IS NULL;
-- Switch reads/writes in app, then drop old columns in a later migration

Connections

Observability

Simple, boring defaults reduce 90% of “why is prod slow?” incidents.