I wonder if you could possibly help me. I have installed PostgreSQL and I have tried running various checks to ensure it is running and I know it is.

Here are the results of searching for the postgres process:

root@myserver [~]# ps aux | grep post
    root     12989  0.0  0.0  61192   736 pts/0    S<+  18:42   0:00 grep post
    postgres 19116  0.0  0.0 120732  3352 ?        S<   Mar14   0:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data
    postgres 19122  0.0  0.0 109908   772 ?        S<   Mar14   0:00 postgres: logger process
    postgres 19124  0.0  0.0 120732   996 ?        S<   Mar14   0:00 postgres: writer process
    postgres 19125  0.0  0.0 110912   700 ?        S<   Mar14   0:00 postgres: stats buffer process
    postgres 19126  0.0  0.0 110100   876 ?        S<   Mar14   0:00 postgres: stats collector process

This to me is solid enough evidence that it is infact running but here is the exact error I am getting:

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"?

This comes in an email when the DB cache attempts to update.

Help is much appreciated and thanks for any response!

  • 3
    You need to answer both of the questions psql posed to you (Is the server running, and is it accepting connections on that socket?). If you can answer yes to both questions please post your server logs - they may tell us what's going on. – voretaq7 Mar 17 '11 at 18:51
  • 1
    You can also try to connect through a local socket, although as voretaq7 says there's more information to fill up – lynxman Mar 17 '11 at 19:00
  • Thanks for the great reply. Sorry to sound amateur but how do I check whether it is accepting connections on that socket or not? Server is definitely running (postmaster (pid 19126 19125 19124 19122 19116) is running...) – Chris Mar 17 '11 at 19:02
  • 1
    @Chris What does ls -l /tmp/.s.PGSQL.5432 say? If it's not found, then try ls -l /tmp/.s.PGSQL.*? My postgresql is configured to put the socket in /var/run/postgresql/s.PGSQL.5432, look there? – DerfK Mar 17 '11 at 19:06
  • This should be a comment, but... please post /etc/postgresql/relevant_version_number/main/pg_hba.conf in your answer or wherever that file is located. You don't say what version of PostgreSQL you are running, though it is probably not important here. – Faheem Mitha Mar 17 '11 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.