I\'ve been trying to set up PostgreSQL on my system (OSX 10.8, clean install), but I\'m running into trouble with using psql, createdb, etc. I\'ve
I encountered this same issue when installing PostgreSQL 9.2 via Homebrew. psql that comes with this build looks to /tmp for a socket when called without any options.
I didn't feel like adding any new environment variables like PGHOST or creating aliases for psql. There's nothing wrong with doing any of these things, but I just didn't feel like adding to the clutter of my environment.
So, why not just set unix_socket_directory in postgresql.conf to /tmp? I did:
unix_socket_directory = '/tmp' # (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
After a reload, I can just run $ psql with no -h option, without having added an alias or environment variable.