List active queries
list_active_queriesMonitor currently running PostgreSQL queries, view each backend's wait event, duration, and blocking PIDs to identify performance bottlenecks.
Instructions
List the queries currently running on the server, with each backend's wait event, duration, and the PIDs blocking it. Returns a list of objects with pid, username, application, state, wait_event (null when not waiting), duration_seconds, query, and blocked_by (list of PIDs holding locks this backend is waiting on).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |