Data and databases · Edition No. 18 · 12 Sep 2026

darold/pgbadger

It reads PostgreSQL's own log file and produces one HTML page naming the slowest queries, in order.

← Data and databasesRead the whole edition →

4.1k stars · PostgreSQL License · v13.2 (2025-12-29), read from /releases/latest on 2026-09-12 with the year shown in full

It reads PostgreSQL's own log file and produces one HTML page naming the slowest queries, in order.

Repo detailsthe review · specs · pros & cons · install

What it is

pgBadger is a single program that reads PostgreSQL log files and produces a self-contained HTML report. The report shows the slowest queries, the most frequent ones, connection counts, locks and errors, with charts over time.What it is good for. Anyone whose own app is getting slower and who does not know why. It answers the question directly instead of asking you to install monitoring and wait a week. It costs nothing to run, it does not stay running, and the report is one file you can open on a laptop. Grasppy maps long conversations, which is exactly the kind of work that ends up doing too many small database queries in a loop. This will show you if that is happening.

Stars4.1k
LicencePostgreSQL License
Latestv13.2 (2025-12-29), read from /releases/latest on 2026-09-12 with the year shown in full
Good
  • It works on log files you already have, so it can tell you something about last week.
  • It leaves nothing running on the server. You run it, you read the page, it is over.
  • The report is a single HTML file. No database, no server, no dashboard to maintain.
Watch for
  • To get a useful report you must first switch on query logging in PostgreSQL. That writes more to disk, so watch your free space for a day.
  • It is written in Perl, an older programming language. It installs fine, but it is not a pip install.
  • The last tagged release was 29 December 2025. That is normal for a mature tool, but it means there is no recent release to point at.
Install
# Debian and Ubuntu package it directly:
sudo apt update
sudo apt install pgbadger
# Switch on query logging in postgresql.conf:
#   log_min_duration_statement = 0
#   log_line_prefix = '%t [%p]: user=%u,db=%d,app=%a,client=%h '
#   log_checkpoints = on
#   log_lock_waits = on
#   log_temp_files = 0
# Reload PostgreSQL, let it run for a day, then:
pgbadger /var/log/postgresql/postgresql-16-main.log -o ~/report.html

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.