Last active
December 25, 2015 18:59
-
-
Save vladimir-e/7024773 to your computer and use it in GitHub Desktop.
init postgres
This file contains hidden or 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
initdb /usr/local/var/postgres -E utf8 # create a database cluster | |
postgres -D /usr/local/var/postgres # serve that database | |
PGDATA=/usr/local/var/postgres postgres # …alternatively | |
If builds of PostgreSQL 9 are failing and you have version 8.x installed, | |
you may need to remove the previous version first. See: | |
https://github.com/mxcl/homebrew/issues/issue/2510 | |
To migrate existing data from a previous major version (pre-9.3) of PostgreSQL, see: | |
http://www.postgresql.org/docs/9.3/static/upgrading.html | |
When installing the postgres gem, including ARCHFLAGS is recommended: | |
ARCHFLAGS="-arch x86_64" gem install pg | |
To install gems without sudo, see the Homebrew wiki. | |
To reload postgresql after an upgrade: | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
initdb /usr/local/var/postgres -E utf8 | |
psql | |
CREATE USER user SUPERUSER PASSWORD 'pass'; | |
\q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment