Question

CentOS / No Longer able to access PostgreSQL

This morning, all the sites were down and I tried to ssh into the server. After failing to log in, I accessed the server through the DO Console and saw a memory overflow error which apparently led to a segfault. I felt I had no choice but to roll back to a prior snapshot. I rebooted PostgreSQL, but I kept getting something like the following:

shutdown [FAIL]
start {OK}

After each Postgres reboot, I get the same as above. When I check to see if Postgres is running, it shows that it is running.

I switched to the postgres user, and $psql and threw this error:

psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I added the localhost path to the /.bash_config and now I have error about not being able to access with the following errors:

psql: could not connect to server: Connection refused
        Is the server running on host [local IP adress] and accepting
        TCP/IP connections on port 5432?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Eh, uninstall and reinstall seems to work as planned.

netstat doesn’t pull up anything.

On the server, can you run:

sudo netstat -plunt

If Postgres is running and listening on port 5432, you should see a line like:

tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      1295/postgres