Skip to content

Instantly share code, notes, and snippets.

@kfitzpatrick
Created April 27, 2011 18:43
Show Gist options
  • Save kfitzpatrick/944901 to your computer and use it in GitHub Desktop.
Save kfitzpatrick/944901 to your computer and use it in GitHub Desktop.
Crappy install of postgres, but it totally works
#!/bin/bash
# This is only for development machines. Probably could be made a lot better.
sudo brew update
sudo chown -R pivotal /usr/local
# blow away default image's data directory
rm -rf /usr/local/var/postgres
brew remove postgresql
brew install postgresql
initdb -U pivotal --encoding=utf8 --locale=en_US /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
# Make the launch agents
mkdir -p ~/Library/LaunchAgents
# start PG on restart
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment