Postgresq-9.2 failed connection to Unix Domain Socket

Asked

Viewed 1,873 times

0

I configured the postgresql-9.2 database in my Ubuntu 14.04 and it shows the following error when communicating with the database

Is the server running locally and Accepting Connections on Unix Domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I’m using it for an application on Rails 3.2.13.

1 answer

1


First open the terminal and run the following command:

ps auxw | grep postgres

If there is no process named postgres, then the bank is not running. If this is your case, enter the following command into your terminal:

sudo service postgresql restart

Casp is running, check the directory permissions /var/run/postgresql/, see if the postgres user has read/write permission. If you do not have this permission, use the following command:

sudo chown postgres /var/run/postgresql/

If it still doesn’t work, find and check your postgres.conf file, look for the line that defines the socket and edit this line with the path /var/run/postgresql

  • I have not yet succeeded. It presents the same error. Finally I added the path in postgres.conf as follows: unix_socket_directory = '/var/run/postgresql'

  • @ygorbr, you even restarted postgre after the postgres.conf issue ?

  • 1

    I solved the problem by uninstalling the whole postgres package and installing again. Thanks for the help Renato.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.