A Manic Developer's Place

Close all connections for a postgres db

December 2, 2016

database postgres

Useful to drop a db quickly…

select pg_terminate_backend(pid) from pg_stat_activity where datname="db";

ManicDev on Github

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/O d-pu s-:+++ a+ C+++ UL+++ P- L++ E--- W+++ N o-- K--? w++ O M+ V PS PE Y+ PGP t+ 5? X+ R tv- b+ DI- D++ G e+ h++ r++ z
------END GEEK CODE BLOCK------