For reasons I can't totally explain, I had both 9.4 and 9.5 installed, which was giving me a headache as I tried to enable PostGIS, which was only installed for 9.5.
I used Synaptic to uninstall postgresql-9.4, and restarted my server with sudo service postgresql start
but now I'm finding that I have a bunch of issues:
PGAdmin can't connect. I'm connecting over localhost on port 5432 — that wouldn't have changed. The connection error says:
Server doesn't listen
The server doesn't accept connections: the connection library reports
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?
In addtion, psql
can't see my old databases, and it doesn't recognize any of the roles that I had set up.
I feel like I'm missing something basic here.
Best Answer
Since you had 2 instances installed, the first (I guess 9.4) was using the default 5432 port so the 2nd got another port (probably 5433). When you uninstalled the first instance, the 2nd doesn't know anything about it and still uses the 5433 port.
You can use
pg_lsclusters
to find what instances have been installed, and some more details like whether the are running or not, their ports, their data directories, etc. Example:So the solution is pretty simple. Tell pgAdmin to connect to port 5433 or whichever port your 9.5 has been setup to listen to.
Alternatively, change the configuration of your 9.5 (second and now only one) instance to use port 5432. You need to edit the postgresql.conf file and restart it.