pgdba vs the alternatives

Where pgdba fits next to monitors, log analyzers, and hosted advisors — and when to use both.

pgdba is an advisor, not a monitor. It answers “what should I fix, in what order, with what SQL” — once per run, on demand or on a schedule. These tools answer different questions, and most teams end up running pgdba alongside one of them.

The map

Tool Question it answers Shape
pgdba What should I fix first, and with what SQL? One-shot CLI: ranked findings + remediation
check_postgres Is anything broken right now? Nagios-style monitor: alerts, no advice
pgBadger What did the logs say happened? Log analyzer: past-tense reports from log files
pganalyze / hosted advisors What do the metrics say over time? Hosted service: dashboards + recommendations
pgMonitor / PoWA How is the cluster behaving? Monitoring stack / workload analyzer

When pgdba is the wrong tool

  • Real-time alerting (“wake me when replication lags”) belongs to a monitor like check_postgres or pgMonitor. pgdba’s cron mode pages on change since baseline (--fail-on-drift), not on live thresholds.
  • Forensic log analysis (“what happened Tuesday at 3am”) belongs to pgBadger over archived logs. pgdba only sees the live database.
  • Fleet dashboards and metric history belong to a hosted advisor or pgMonitor. pgdba serve keeps per-target history, but it is a JSON API, not a dashboard.

When pgdba earns its place

  • Before touching production: one read-only run ranks what is actually hurting, with the cost of ignoring each item — the incident doc writes itself. See slow-query triage.
  • Pre-deploy and CI gates: exit codes 0/1/2/3 plus --fail-on-drift stop a pipeline on new findings. See recurring checks.
  • Migrations with proof: preflight gates, resume, and row-count verification in one tool. See the migrate safe lane.
  • Agents and automation: every command emits one strict-JSON document (--agent), and pgdba serve exposes the same shapes over HTTP. See agent-driven maintenance.

The honest version: keep your monitor for paging, keep your log analyzer for forensics, and run pgdba when a human (or an agent) needs to decide what to change next.