How to kill all sessions in Postgres so that they stay dead.
Have you ever tried to drop or rename a postgres database or even create another database from one as a template, only to be confronted by the dreaded message: postgres=# create database test with template a_database; ERROR: source database “a_database” is being accessed by other users DETAIL: There are 40 other sessions using the database. …