postgres show process list

\c postgres

SELECT *
FROM pg_stat_activity
WHERE datname = 'mydb';

Kill connections to database if you want:

SELECT
pg_terminate_backend (pid)
FROM
pg_stat_activity
WHERE
datname = 'mydb';

Leave a Reply

Your email address will not be published. Required fields are marked *