Like some others I am getting this error when I run rake db:migrate in my project or even try most database tasks for my Ruby on Rails 3.2 applications.
Check there is no postmaster.pid in your postgres directory, probably /usr/local/var/postgres/
/usr/local/var/postgres/
remove this and start server.
Check - https://github.com/mperham/lunchy is a great wrapper for launchctl.