My main home server had issues previously getting postgres installed.
However for an application switch to Heroku I've wanted to get it working.
Though not 100% necessary, as I could have (say) mysql locally and pg remotely, I much prefer having the same database and eliminating complexity 🙂
Adding pgadmin3 for admin.
postgres is a little more work to set up than mysql, e.g.
castle2011 unix box – postgres:
user/pass – postgres/******
Start with: sudo apt-get install postgresql
sudo vi /etc/postgresql/8.4/main/postgresql.conf
remove the # comment sign before "listen_addresses"
then sudo -u postgres psql template1
then, in sql prompt, e.g. template1=# use `ALTER USER postgres with encrypted pword '*****';`
then sudo vi /etc/postgresql/8.4/main/pg_hba.conf
q to exit (exit and quit do not work).
# or via the -i or -h command line switches.
local all postgres md5
# DO NOT DISABLE!
sudo /etc/init.d/postgresql restart
restarts the server
`psql` and password