Micellaneous:
check backends connections
cancel backends connections
To sum numbers of connections:
SELECT sum(numbackends) FROM pg_stat_database;
To cancel all connections not including my own:
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE pid <> pg_backend_pid()