I followed these steps to install PostgreSQL with Homebrew (first time using Homebrew): http://dhilipsiva.blogspot.se/2013/02/install-postgresql-on-os-x-using.html
The last step didn't work. I assume it is supposed to start the server. However, I think I successfully created a database cluster and started the database server following the official documentation (17.2 and 17.3): http://www.postgresql.org/docs/9.2/interactive/runtime.html
My problem is that when I try to create a database using createdb mydb
in the terminal, I get the message:
createdb: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
I'm very confused since a lot of the concepts being thrown around here (like sockets, path variables etc) are new to me. I'm also confused about the directory structure in Mac OS X, since I recently migrated from Windows. If anyone could just point me in the right direction it'd be much appreciated.
Update As always, once you post, you find the answer. Well almost: the accepted answer in this post leads me to the conclusion that my Unix domain socket (whatever that is) is located in a place that Postgres doesn't expect.
Using the -h flag, it works. So the question is, how do I configure Postgres to look for the socket in the right place?