The PostgreSQL advisor for teams that ship.
pgdba runs 68 read-only health checks against your Postgres 13–17 database, ranks what to fix first, and migrates databases server-to-server — nothing writes without an explicit flag.
Two commands to a healthier database
$ uv tool install pgdba
$ pgdba config init # probes your connection, writes pgdba-run.toml (chmod 600)
$ pgdba check # read-only check, zero flags
What a run looks like
Real output, trimmed for width — every finding carries its duty, risk, cost of ignoring, and ready-to-review SQL:
$ pgdba check --connection prod
Health grade: F (6 critical, 89 warning, 133 info)
Duty groups: Query tuning: 21 findings — fix the top offenders first;
Configuration: 9 findings — settings off their healthy range slow every query
Top actions:
1. SET config.shared_buffers — undersized buffer pool keeps forcing reads to disk
2. SET config.work_mem — sorts keep spilling to temp files
3. REVIEW security.auth.ssl_off — credentials cross the network in cleartext
$ pgdba fix config.shared_buffers
fix plan for config.shared_buffers: 1 statement(s), 1 with recorded reverts
scripts: pgdba-fix-config.shared_buffers.sql, .revert.sql
Advises, never surprises
Every session is a read-only transaction with a statement timeout. Remediation is printed, ranked, and only executed when you explicitly --apply it — per-action confirm included.
Safe lane migrations
Preflight gates, resume, and verification — dry-run with --plan-only first. Measured at 48 MB/s on the benchmarks page.
Plain language by design
Every finding carries a why, a cost-of-ignoring, and an ignore-if. Every flag has a safe default: pgdba check --explain-flag pooled. Job-by-job guides.
Fleets and always-on
One command across N databases with fleet-common rollups, or serve the advisor with scheduled checks and a read-only JSON API.
Reviewed fixes, reversible
Turn one finding into a plan with per-statement reverts recorded at plan time — dry-run by default, resumable applies, honest manual fallbacks.
Proof, not promises
A zero-write audit journal plus self-scan that turns the checks on the tool itself. Agents get one strict-JSON document per command.