Skip to main content

PostgresAI vs pgBadger

continuous monitoring vs log file reports

pgBadger is an open-source PostgreSQL log analyzer that builds HTML reports from log files. PostgresAI monitors continuously and files findings as Issues with a fix.

See plans and pricingOpen the live demoTalk to us

Checked on against 4 pages of pgBadger documentation. PostgreSQL only. Markdown

Where PostgresAI is ahead of pgBadger​

Each point pairs what our documentation says with what the pgBadger documentation says. Follow the links and check.

  1. Wait events with no extra extension

    PostgresAI

    An ASH-style wait event dashboard built from samples of pg_stat_activity. No extra extension is needed. docs

    pgBadger

    pgBadger reports lock waits from the logs when log_lock_waits is on: the most frequent waiting queries and the queries that waited the most. The sources we reviewed do not describe wait event sampling. 1

  2. An AI agent can work through the findings

    PostgresAI

    The postgresai CLI and an MCP server give an agent the Issues, action items and checkup reports. The setup guide covers Cursor, Claude Code, Windsurf and Codex. docsdocs 2

    pgBadger

    pgBadger can write its reports as JSON for other tools to read. The sources we reviewed do not describe an MCP server or an interface for AI agents. 1

  3. Every finding comes with a fix

    PostgresAI

    Scheduled checkups turn each finding into an Issue with severity, evidence and a specific fix. docsdocs 2

    pgBadger

    pgBadger reports on checkpoints, autovacuum per table, temporary files, cancelled queries and errors by class. The sources we reviewed do not describe recommendations or fixes for what it finds. 1

Short answer​

pgBadger, by Gilles Darold, is a PostgreSQL log analyzer: a Perl script that reads PostgreSQL and PgBouncer log files and writes HTML reports on slow queries, errors, locks, checkpoints, autovacuum and connections. It works from log files after the fact and answers a different question: what the logs say happened. PostgresAI collects statistics continuously, samples wait events and turns checkup findings into Issues. The two can run side by side; pick pgBadger when you need per-statement detail from logs, and add monitoring for live metrics and alerts.

When pgBadger is the better choice​

  • Open source under the PostgreSQL Licence; a single Perl script with no server, agent or database to run.
  • Reports from logs cover what statistics views do not keep: errors by class, cancelled queries, lock waits, temporary files, checkpoints, autovacuum per table, sessions and connections.
  • Reads log formats from stderr, csvlog, jsonlog and syslog to Amazon RDS, Cloud SQL, Heroku logplex and CloudNativePG, from local files, SSH or journalctl.
  • Parses PgBouncer logs into reports on throughput, sessions, connections and pools.
  • Incremental mode builds a daily report and a cumulative weekly report, and can process logs in parallel on several CPUs.
The Issues list in the PostgresAI Console: unused indexes consuming 19.2 GiB, redundant indexes that can be deleted to save 3.76 GiB, an invalid index and estimated index bloat, each opened by a checkup.

What you get​

Checkup findings as Issues in the PostgresAI Console. How it works

See plans and pricingOpen the live demoTalk to us

PostgresAI and pgBadger, side by side​

QuestionPostgresAIpgBadger
What it isPostgreSQL monitoring with scheduled health checkups. Findings become Issues with severity, evidence and a recommended fix, which you, your AI agent or a PostgresAI expert can act on. docsdocs 2A PostgreSQL log analyzer: a standalone Perl script that parses PostgreSQL and PgBouncer log files and writes HTML, JSON, text or binary reports. It runs when you call it, for example from cron, and can build daily and weekly incremental reports. 12
Where your Postgres can run, and which versionsYesAmazon RDS and Aurora, Google Cloud SQL, Azure Database for PostgreSQL, Supabase, Tiger Data, self-managed servers and Postgres running on Kubernetes. PostgreSQL 14 and newer, with the pg_stat_statements extension. docsYesAny server whose logs you can read: local files, remote files over SSH, journalctl output, Heroku logplex streams, Amazon RDS and CloudWatch logs, and Cloud SQL and CloudNativePG JSON logs. 1
Where it runs and what it collectsYesHosted by PostgresAI, or self-hosted in your own cloud account or on your own server. It collects database metadata such as statistics, normalized query texts and wait events, not table data or query parameters. docsdocs 2YesRuns on your own machine with Perl; charts render in the browser. Optional Perl modules are needed for CSV input and JSON output. It works from log files, which can be fetched from remote hosts over SSH. 1
Open sourceYesThe monitoring software is open source under Apache 2.0. Hosted plans are a separate paid service. docsdocs 2YesFree software under the PostgreSQL Licence. Version 13.3 was released on 2026-11-03. 143
Query performance analysisYesTop queries from pg_stat_statements by calls, execution time, planning time and rows, with a drill-down dashboard for a single query. For execution plans, Joe runs EXPLAIN on a DBLab clone. docsdocs 2YesFrom logged statements: slowest queries, queries that took the most time, most frequent queries, histograms of query times and prepare/bind statistics. Needs log_min_duration_statement; it also processes auto_explain output and links to a graphical explain tool. 1
Wait event analysisYesAn ASH-style wait event dashboard built from samples of pg_stat_activity. No extra extension is needed. docsPartlyWith log_lock_waits on, reports show the most frequent waiting queries, the queries that waited the most and lock statistics. The sources we reviewed do not describe wait event sampling. 1
Health checks and recommendationsYesScheduled checkup reports on settings, autovacuum and bloat, and indexes (invalid, unused, redundant). Each finding becomes an Issue with severity, evidence and a specific fix. docsdocs 2Not documentedReports cover checkpoints, autovacuum and autoanalyze per table, temporary files, cancelled queries and errors by class. The sources we reviewed do not describe recommendations or scheduled checks. 1
AI and agent accessYesThe postgresai CLI (alias pgai) and an MCP server with tools for Issues, action items and checkup reports. The setup guide covers Cursor, Claude Code, Windsurf and Codex. docsdocs 2Not documentedReports can be written as JSON for other tools to read. The sources we reviewed do not describe an MCP server or an interface for AI agents. 1
Testing a fix before productionYesWith DBLab Engine, a separate open-source product: a full-size thin clone of the database in seconds, where an index or query change can be run on real data. DBLab is set up and priced separately. docsdocs 2Does not applypgBadger reports on statements that already ran and were logged. The sources we reviewed do not describe testing changes. 1
Human PostgreSQL expertsYesScale includes two expert requests a month, answered within 24 business hours. Either plan can buy a one-off pack of two requests for $500. Consulting is separate. docsdocs 2Not documentedThe pgBadger site points readers to the PostgreSQL Professional Services list for commercial support. The sources we reviewed do not describe support offered by the maintainer. 2
AlertsEmail and Slack alerts on Starter and Scale. docsWatch mode (-w) reports only errors, like logwatch. The sources we reviewed do not describe alert notifications. 1
History kept14 days on Starter, 13 months on Scale, custom on Enterprise. docsReports are files you keep. In incremental mode, --retention sets the number of weeks to keep; the default, 0, disables removal. 1
Security attestationsSOC 2 Type 2 examination completed for the Security and Availability criteria, covering March 4 to June 4, 2026. The SOC 3 report is public. docspgBadger is software you run yourself. The sources we reviewed do not describe security attestations. 1

Pricing​

ProductPlanList priceNotes
PostgresAIStarter$16 per cluster/monthPrimary only, 14-day retention, no expert requests included
PostgresAIScale$512 per cluster/monthPrimary and up to 5 replicas in one cluster, 13-month retention, Grafana dashboards, 2 expert requests a month
PostgresAIEnterpriseCustomContact sales
PostgresAISelf-hostedNo licence feeOpen source under Apache 2.0; you run it yourself
pgBadgerOpen sourceFreePostgreSQL Licence; a Perl script you run 14

List prices on 18 Nov 2026. The billing units differ, so this is not a total-cost comparison. PostgresAI pricing

Using PostgresAI with pgBadger​

pgBadger and PostgresAI answer different questions and run side by side: pgBadger reads PostgreSQL logs, which needs settings such as log_min_duration_statement, while PostgresAI monitoring reads statistics views and needs pg_stat_statements. A slow query found in either can be tested on a full-size DBLab clone, since DBLab copies any PostgreSQL source.

Questions​

Is pgBadger a monitoring tool?
pgBadger is a log analyzer. It builds reports from PostgreSQL log files when you run it, for example daily from cron in incremental mode. It reads log files and does not sample live metrics, so it can run alongside a monitoring tool. 1
Does pgBadger work with Amazon RDS?
Yes. pgBadger has an rds log format that auto-detects Amazon RDS and CloudWatch PostgreSQL logs. It also reads Cloud SQL and CloudNativePG JSON logs and Heroku logplex streams. 1
What PostgreSQL settings does pgBadger need?
Query logging through log_min_duration_statement, a log_line_prefix with a time and a process escape, and, for fuller reports, log_checkpoints, log_connections, log_disconnections, log_lock_waits, log_temp_files and log_autovacuum_min_duration. Log messages must be in English. 1
Can I use PostgresAI and pgBadger together?
Yes. pgBadger reads logs and PostgresAI monitoring reads statistics views, so both can run against the same server. DBLab, the PostgresAI cloning product, can then test a fix for a slow query on a full-size clone.

Check it on your own database​

The express checkup works with PostgreSQL 14 or newer. With --no-upload it needs no account and sends no report data to PostgresAI. It needs Node.js 18 or newer and a database role with pg_monitor. Compare what it finds with what your current tool shows for the same database.

See plans and pricingOpen the live demoTalk to us

Sources​

  1. pgBadger repository README
  2. pgBadger website
  3. pgBadger ChangeLog
  4. pgBadger license

These pages compare what each product does for PostgreSQL; other databases and the rest of the stack are out of scope. What we say about the other product comes from its own documentation, pricing page, changelog or source repository, read on the date shown; each row cites its source. "Not documented" means we did not find it in those sources, not that the product cannot do it. Prices are list prices and the billing units differ, so they are not a total-cost comparison. Product names are trademarks of their owners. Found a mistake? Tell us and we will correct the page.