$ psql foo
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
Change this:
unix_socket_directory = ''
To this:
unix_socket_directory = '/var/pgsql_socket/'
Create and change the owner of this dir, putting the owner of the postgres.
$ mkdir /var/pgsql_socket
$ chmod ....
$ chown ....
Then restart postgres:
$ pg_ctl -D /usr/local/var/postgres -l logfile stop
$ pg_ctl -D /usr/local/var/postgres -l logfile start