Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Postgres on macos or OSX - Fix
# ** ERROR 1 **
# FATAL: lock file "postmaster.pid" already exists
# HINT: Is another postmaster (PID 4646) running in data directory "/usr/local/var/postgres"?
#
# ** ERROR 2 **
# Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
#
# To fix one of this errors:
cat /usr/local/var/postgres/postmaster.pid # pid is the number on first line
kill -9 1116 # replace 1116 with pid number (first line) from postmaster.pid file
# Or
pg_ctl -D /usr/local/var/postgres stop
pg_ctl -D /usr/local/var/postgres start
# Or
cd /usr/local/var/postgres
mv postmaster.pid postmaster.backup
pg_ctl -D /usr/local/var/postgres start
rm postmaster.backup
@omnikron

This comment has been minimized.

Copy link

omnikron commented Apr 3, 2013

awesome, thanks

@jkarmel

This comment has been minimized.

Copy link

jkarmel commented Jul 10, 2013

yes thank you, this was helpful!

@leonardorb

This comment has been minimized.

Copy link

leonardorb commented Nov 21, 2013

Thanks!

@roberta-almeida

This comment has been minimized.

Copy link

roberta-almeida commented Dec 12, 2013

Thaank you!! Very, very helpful!! :)

@nathancolgate

This comment has been minimized.

Copy link

nathancolgate commented Dec 19, 2013

Thanks!

@kamag7

This comment has been minimized.

Copy link

kamag7 commented Dec 20, 2013

I have other problem. I've tried this
"pg_ctl -D /Library/PostgreSQL/9.3/bin/postgres start"
and I got
pg_ctl: could not open PID file "/Library/PostgreSQL/9.3/bin/postgres/postmaster.pid": Not a directory

Please help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.