finds.dev← search

// the find

dalibo/pg_activity

★ 3,026 · Python · PostgreSQL · updated Jul 2026

pg_activity is a top like application for PostgreSQL server activity monitoring.

pg_activity is htop for PostgreSQL — a terminal UI that shows live query activity, blocking queries, wait states, and system resource usage per connection. It's aimed at DBAs and developers who want to see what their Postgres instance is actually doing right now without writing ad-hoc pg_stat_activity queries.

The three-tab layout (running, waiting, blocking) is genuinely useful during incident triage — you can switch between them with F1/F2/F3 while a slow query piles up locks. The version-specific SQL files (post_090200, post_100000, etc.) show real care about backward compatibility across a decade of Postgres releases. Configuration profiles and per-column display toggles make it usable on narrow terminal windows without fighting the layout. The OSC 52 clipboard support for copying queries works over SSH, which matters since you're usually SSHing into the server anyway.

Requires superuser or at least the postgres OS user to show system-level metrics (CPU, memory, I/O per process); on managed databases like RDS or Cloud SQL you get a degraded mode that drops half the interesting columns. The 0.5–5 second refresh floor means short queries that complete between polls are invisible — you'll miss the query you were actually trying to catch if it's fast enough. No historical data: it's purely a live view, so if something bad happened five minutes ago you get nothing. The `--filter` option only supports filtering by `dbname`, which is thin — you can't filter by user, application name, or query text.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →