#Notes on Installing PostgreSQL from RailsCasts
##References
- http://railscasts.com/episodes/342-migrating-to-postgresql
- http://jeffammons.net/2011/09/fixing-postgres-on-mac-10-7-tiger-for-django/
##Steps command to check version
psql --version
command to install
brew install postgresql
command to setup
initdb /usr/local/var/postgres
command to start server
pg_ctl -D /user/local/var/postgres -l logfile start
##Errors
###Error Message: Could not create shared memory segment: Cannot allocate memory
In your terminal, reset memory allocation
$ sudo sysctl -w kern.sysv.shmall=65536
$ sudo sysctl -w kern.sysv.shmmax=16777216
###Error: System refers to /usr/bin/psql directory
In your terminal, test with:
which psql
probably says: /usr/bin/psql
Add this line to your ~/.bash_profile:
export PATH=/usr/local/bin:$PATH
In terminal refresh with:
source ~/.bash_profile
Now, a quick "which psql" should say:
/usr/local/bin/psql