Last active
August 29, 2015 13:59
-
-
Save rchampourlier/10591132 to your computer and use it in GitHub Desktop.
A gist for installing PostgreSQL with appropriate configuration on MacOS X.
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
#!/usr/bin/env bash | |
# A gist for installing PostgreSQL with appropriate | |
# configuration on MacOS X. | |
# | |
# MIT License | |
# | |
# Copyright © 2014 Romain Champourlier <[email protected]> | |
brew update | |
brew install postgres | |
# Configure for UTF-8 | |
initdb --encoding=UTF8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8 --pgdata=/usr/local/var/postgres | |
# Link startup items | |
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents | |
# Configure launch agents | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
# Start it now | |
launchctl start homebrew.mxcl.postgresql | |
# Add the extension for PGAdmin | |
psql postgres -c 'CREATE EXTENSION "adminpack";' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment