Skip to content

Instantly share code, notes, and snippets.

@ivermac
Last active September 1, 2018 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivermac/4782dab689f63eb242929142b2a15f9f to your computer and use it in GitHub Desktop.
Save ivermac/4782dab689f63eb242929142b2a15f9f to your computer and use it in GitHub Desktop.
Postgres Cold Reboot fix on OSX

I use brew's postgresql service and after cold reboot on the mac I was using, I got the following when I tried to access psql on the command line:

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

I got my fix from here. In a nutshell, the postmaster.pid file already exists and has to be removed. Removing file that file fixed it for me i.e.

rm -f /usr/local/var/postgres/postmaster.pid

You might also want to to checkout the postgres log file (tail -n 10 /usr/local/var/log/postgres.log) for any errors and bugs.

Homebrew version: 1.7.2 Homebrew/homebrew-core (git revision c4e37; last commit 2018-08-27) psql/postgresql version: 10.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment