Skip to content

Instantly share code, notes, and snippets.

@bradgessler
Created November 2, 2024 06:52
Show Gist options
  • Save bradgessler/57c5df80d086edf38fa5cf6a58246113 to your computer and use it in GitHub Desktop.
Save bradgessler/57c5df80d086edf38fa5cf6a58246113 to your computer and use it in GitHub Desktop.
Restart Postgres from a crashed Mac
# When macOS crashes and Postgres is running, it won't start if the `postmaster.pid` file is present.
# Careful. If you don't know what you're doing you can lose data.
# Use only on Postgres instances you don't care about or have done the work to look at the crashed data.
# Tail the logs
tail -f $(brew --prefix)/var/log/[email protected]
# Stop Postgres
brew stop postgres
# Delete the pid
rm $(brew --prefix)/var/postgres/postmaster.pid
brew start postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment