After updating postgres
brew formula or OS X
, afterwards there could be an error similar to:
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"?
One possible fix is:
rm /usr/local/var/postgres/postmaster.pid
brew services restart postgresql