PostgreSQL error 'Could not connect to server: No such file or directory'
Check there is no postmaster.pid in your postgres directory, probably /usr/local/var/postgres/
remove this and start server.
Check - https://github.com/mperham/lunchy is a great wrapper for launchctl.
"Postgres.app" is a better fix if you are on OS X
Here is the fix:
- Stop the database
cd /var
sudo rm -r pgsql_socket
sudo ln -s /tmp pgsql_socket
chown _postgres:_postgres pgsql_socket
- Restart PostgreSQL (not your computer)
More information is available at "postgresql 9.0.3. on Lion Dev Preview 1".