Description
pg_activity is a command-line tool for watching PostgreSQL server activity, in the style of the Unix top command. It shows the sessions running on a server in a live-updating view, so you can spot slow or blocked queries and see what the database is doing right now. It works locally or remotely, and it can connect to a database using a connection string. For the best results the system user running the tool should be the same as the PostgreSQL server user, usually postgres, or a user with more rights such as root, and the PostgreSQL user should be a superuser. Without those rights it falls back to a degraded mode in which some system information and temporary file data are not shown. The project has a configuration profile system stored in a config folder, so you can save connection settings. It can be installed from Linux distribution packages, from PyPI with pip or pipx alongside psycopg, or from source for development versions. It is maintained by Dalibo and is open source on GitHub.…
Highlights
- Live top-style view of PostgreSQL sessions
- Works locally or remotely with a connection string
- Configuration profiles for saved connections
- Install from distro packages, PyPI or source
Ratings & Reviews
No ratings yet
Be the first to rate PG Activity.
People also visit
Pgmetrics
Collect and display information and stats from a running PostgreSQL server
Collector
pganalyze statistics collector for gathering PostgreSQL metrics and log data

clickhouse-managed-postgres-rca
MUST USE when investigating performance issues on a ClickHouse-managed Postgres
PG Activity FAQ
What does pg_activity do?
It shows PostgreSQL server activity in a live top-style view, so you can see running sessions and spot slow or blocked queries.
How do I install it?
Use your Linux distribution's package, run pip install with the psycopg extra, or install with pipx to keep it isolated.
Do I need superuser access?
The README recommends a PostgreSQL superuser so the tool can show as much data as possible. Without it, some system information and temporary file data are hidden.
Can I monitor a remote server?
Yes. The tool works locally or remotely, and you give it a connection string.
Is it free?
Yes. The source is public on GitHub, so it is open source.
What are the best PG Activity alternatives?
Popular alternatives to PG Activity include Pgmetrics, pgweb and Collector. See all PG Activity alternatives




