PostgreSQL socket not listening on the right one I'm trying to get my PostgreSQL to work.

It is clearly running, according to: ps aux | grep postgres | grep -v grep

I am getting -

username            5781   0.0  0.0  2441364    524   ??  Ss    9:05AM   0:00.33 postgres: stats collector process       
username            5780   0.0  0.0  2445216   1628   ??  Ss    9:05AM   0:00.19 postgres: autovacuum launcher process       
username            5779   0.0  0.0  2445084    532   ??  Ss    9:05AM   0:00.14 postgres: wal writer process       
username            5778   0.0  0.0  2445084    576   ??  Ss    9:05AM   0:00.14 postgres: writer process       
username            5777   0.0  0.0  2445084    592   ??  Ss    9:05AM   0:00.00 postgres: checkpointer process       
username            5775   0.0  0.1  2445084   3544   ??  S     9:05AM   0:00.12 /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log
username            6044   0.0  1.6  2884196  66420   ??  S     9:44AM   0:21.62 /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -classpath /Applications/RubyMine.app/plugins/DatabaseSupport/lib/jdbc-console.jar:/Applications/RubyMine.app/lib/util.jar:/Users/username/Library/Preferences/RubyMine50/jdbc-drivers/postgresql-driver-license.txt:/Users/username/Library/Preferences/RubyMine50/jdbc-drivers/postgresql-9.1-901.jdbc3.jar com.intellij.persistence.database.console.RemoteJdbcServer org.postgresql.Driver


But when I try to createuser -s -U $USER, I am getting:

createuser: 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"?


However, it is clearly running, but just not talking to the correct socket. I tried: sudo find / -name .s.PGSQL.5432 -ls and am getting:

find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
48453370        0 srwxrwxrwx    1 username   wheel    0 Apr 24 11:59 /private/tmp/.s.PGSQL.5432


How do I get PostgreSQL to talk with the correct socket?

Update:

I checked ls -la under /var/pgsql_socket/.s.PGSQL.5432:

total 0
drwxrwxrwx   2 _postgres  _postgres   68 Sep  19  2011 .
drwxr-xr-x  28 root       wheel      952 Nov   8  2011 ..
Try the following command:

createuser -h 127.0.0.1 -s new_role 


And if you want to connect your db by using psql interface:

psql -h 127.0.0.1 db_name role_name