Skip to content

Instantly share code, notes, and snippets.

@tigrish
Created July 4, 2010 23:01
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 tigrish/463839 to your computer and use it in GitHub Desktop.
Save tigrish/463839 to your computer and use it in GitHub Desktop.
Installing postgres with ports on Snow Leopard
sudo port install postgresql84 postgresql84-server
# add this to your path
:/opt/local/lib/postgresql84/bin
# some setup steps
sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb
sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'
# create a user and a database
createuser --superuser <username> -U postgres
createdb <dbname>
# start up postgres
sudo su postgres -c '/opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment