Skip to content

Instantly share code, notes, and snippets.

@rchampourlier
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rchampourlier/10591132 to your computer and use it in GitHub Desktop.
Save rchampourlier/10591132 to your computer and use it in GitHub Desktop.
A gist for installing PostgreSQL with appropriate configuration on MacOS X.
#!/usr/bin/env bash
# A gist for installing PostgreSQL with appropriate
# configuration on MacOS X.
#
# MIT License
#
# Copyright © 2014 Romain Champourlier <romain@softr.li>
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