# pg_stat_activity

> pg_stat_activity is a PostgreSQL view with one row per server process, showing its state and current or last query.

Source: https://sqleye.com/docs/glossary/pg-stat-activity/ · Last updated: 2026-11-29 · Publisher: CodeROG (https://coderog.com)

pg_stat_activity is a PostgreSQL statistics view with one row per server process, showing that process's current activity: its state, the query it is running or last ran, and what it is waiting on.

SQLEye reads it for the Connections tab of a PostgreSQL instance, listing client backends and excluding its own. Each row shows the connection id, user, database, application name, client address, state, current SQL (the first 8,192 bytes) and how long it has been in that state. On MySQL, the equivalent comes from performance_schema.threads.

pg_stat_activity shows what is happening right now, not a history. The statement history in the Live screen comes from the server log instead; see [jsonlog](/docs/glossary/jsonlog/) and [Capture](/docs/live-eye/capture/).
