PostgreSQL - kill all processes except my own connection Piotr Synowiec ~1 min read February 2, 2022 Categories DEV Tags postgresql How to kill all processes except my own connection to specific DB SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = 'database_name'; where ‘database_name’ is your DB that you are working on. Share Tweet LinkedIn Reddit Previous PostgreSQL - check current DB operations Next PostgreSQL - check table definition