I began receiving these errors consistently after running a script that collects and stores data in psql:
Could not connect because of FATAL: remaining connection slots are reserved for non-replication superuser connections
I am running psql on Ubuntu. So I decided to restart psql with:
sudo service postgresql restart
Now however, psql has shut down completely
Could not connect because of could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
I am completely new to maintaining psql on a server and would be grateful for any advice.
Where do I even begin to solve this problem? How can I get psql to start again without losing any data that is in this massive database?
select * from pg_stat_activity;
to see what's going on.