Posted By

jmccartie on 04/05/11


Tagged


Versions (?)

Homebrew Postgresql Caveats


 / Published in: Bash
 

  1. If builds of PostgreSQL 9 are failing and you have version 8.x installed,
  2. you may need to remove the previous version first. See:
  3. https://github.com/mxcl/homebrew/issues/issue/2510
  4.  
  5. To build plpython against a specific Python, set PYTHON prior to brewing:
  6. PYTHON=/usr/local/bin/python brew install postgresql
  7. See:
  8. http://www.postgresql.org/docs/9.0/static/install-procedure.html
  9.  
  10.  
  11. If this is your first install, create a database with:
  12. initdb /usr/local/var/postgres
  13.  
  14. If this is your first install, automatically load on login with:
  15. mkdir -p ~/Library/LaunchAgents
  16. cp /usr/local/Cellar/postgresql/9.0.3/org.postgresql.postgres.plist ~/Library/LaunchAgents/
  17. launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
  18.  
  19. If this is an upgrade and you already have the org.postgresql.postgres.plist loaded:
  20. launchctl unload -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
  21. cp /usr/local/Cellar/postgresql/9.0.3/org.postgresql.postgres.plist ~/Library/LaunchAgents/
  22. launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
  23.  
  24. Or start manually with:
  25. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
  26.  
  27. And stop with:
  28. pg_ctl -D /usr/local/var/postgres stop -s -m fast
  29.  
  30. If you want to install the postgres gem, including ARCHFLAGS is recommended:
  31. env ARCHFLAGS="-arch x86_64" gem install pg
  32.  
  33. To install gems without sudo, see the Homebrew wiki.

Report this snippet  

You need to login to post a comment.