I have a script in PostgreSQL which restores test database from dump every night. The database is accessed by app servers and processes with connection pool which keeps a fe
Starting PostgreSQL 9.5 we finally can:
ALTER DATABASE db WITH ALLOW_CONNECTIONS false;