Skip to content

Instantly share code, notes, and snippets.

@ideaMarcos
Last active September 19, 2021 16:49
Show Gist options
  • Save ideaMarcos/aad868bbb65e502ba01ab7333b6676ec to your computer and use it in GitHub Desktop.
Save ideaMarcos/aad868bbb65e502ba01ab7333b6676ec to your computer and use it in GitHub Desktop.
homebrew postgresql
#!/bin/sh
brew install postgresql
brew services start postgresql
createdb `whoami`
# https://stackoverflow.com/questions/15301826/psql-fatal-role-postgres-does-not-exist
psql # to test login works
createuser -s postgres
psql -U postgres # to test login works
# https://blog.testdouble.com/posts/2021-01-28-how-to-completely-uninstall-homebrew-postgres/
brew uninstall postgres
rm -rf /usr/local/var/postgres
rm /usr/local/var/log/postgres.log
rm -f ~/.psqlrc ~/.psql_history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment