Psql refusing connections after restart
I began receiving these errors consistently after running a script that collects and stores data in psql:


Your max_connections is too low, or that script isn't dying or releasing the connection.

If you're getting Connection refused after you restart, then perhaps you have multiple copies of postgresql installed on the same machine and you mean to connect to a different port (like 5433). If you're using Ubuntu or Debian run pg_lsclusters and paste the output.