# postgresql - socket not working after 9.5.7 upgrade

## nitro322

I run postgresql on my server and use pg_dumpall to backup the databases in a nightly cron job.  Been working fine for years, but after the recent 9.5.7 upgrade I began receiving this error:

```
pg_dumpall: could not connect to database "template1": could not connect to server: No such file or directory

   Is the server running locally and accepting

   connections on Unix domain socket "/run/postgresql/.s.PGSQL.5432"?

Error: PostgreSQL databases could not be dumped
```

After troubleshooting, sure enough the socket no longer existed at /run/postgresql/.s.PGSQL.5432, nor apparently anywhere else on my system.  I fiddled with the postgresql.conf file to explicitly define it in a couple different locations with no luck.  Tried searching for troubleshooting info on this, but everything I found referred to much older versions, Mac versions, or just general misconfigurations.  In order to verify it was caused by the 9.5.7 upgrade, I downgraded to 9.5.5, restarted, and it was back.

Any ideas on how to get the socket working in 9.5.7?  Anyone else running postgresql - do you have the same problem?  I don't think I should have any kind of special configuration that would cause this.

Appreciate any guidance.  Thanks.

----------

## adsmol

I had the same. I my case helped adding line:

```
PG_SOCKET_DIRECTORIES="/run/postgresql"
```

to file /etc/conf.d/postgresql-9.5 and restarting the server.

----------

## nitro322

Thank you so much for the suggestion.  Just upgraded again and tried that, and it works like a champ.

Much appreciated.

----------

