On Heroku, the pg-extras
CLI Plugin is available.
List currently running queries that have been running for longer than 5 minutes. Heroku dynos have a 30-seconds disconnect so queries still running after 5 mins are usually problematic and can slow down the entire DB.
List queries that are currently holding locks that other queries are waiting to be released. Long-running locks can block an entire table.
List queries that have taken out an exclusive lock on a relation.
Kill query.
Force-kill query.