On any DB, using my pg-top CLI Plugin.

Long-Running Queries #

List currently running queries that have been running for longer than 10 seconds.

pgtop queries:long-running

Blocking Queries #

List queries that are currently holding locks that other queries are waiting to be released.

pgtop queries:blocking

Idle Queries #

List idle queries.

pgtop queries:idle

Kill a Query #

pgtop queries:cancel PID

Force-kill query #

pgtop queries:terminate PID