Drop database connections in PostgreSQL

SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname = 'db_name'