Created
November 2, 2024 06:52
-
-
Save bradgessler/57c5df80d086edf38fa5cf6a58246113 to your computer and use it in GitHub Desktop.
Restart Postgres from a crashed Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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