title: postgres: localhost not connecting
body: <p>My <code>postgreSQL.conf</code> looks like</p>
  
  <pre><code># - Connection Settings -
  
  listen_addresses = '*'          # what IP address(es) to listen on;
                                          # comma-separated list of addresses;
                                          # defaults to 'localhost', '*' = all
                                          # (change requires restart)
  port = 5432                             # (change requires restart)
  </code></pre>
  
  <p>and I also know that postgres is running</p>
  
  <pre><code>air:data postgres$ ps -aef | grep postgres
    504 16474 16473   0 11:34AM ??         0:00.00 postgres: logger process
    504 16476 16473   0 11:34AM ??         0:00.00 postgres: writer process
    504 16477 16473   0 11:34AM ??         0:00.00 postgres: wal writer process
    504 16478 16473   0 11:34AM ??         0:00.00 postgres: autovacuum launcher process
    504 16479 16473   0 11:34AM ??         0:00.00 postgres: stats collector process
      0 16087 16078   0 10:54AM ttys001    0:00.03 su - postgres
    504 16473     1   0 11:34AM ttys001    0:00.22 /Library/PostgreSQL/9.1/bin/postgres -D/Library/PostgreSQL/9.1/data
    504 16484 16088   0 11:34AM ttys001    0:00.00 grep postgres
  </code></pre>
  
  <p>But I am not able to connect</p>
  
  <pre><code> psql -Uuser -W
  Password for user user:
  psql: 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"?
  </code></pre>
  
  <p>Also, when I run the following</p>
  
  <pre><code> lsof -i tcp:5432
   ✘ me@air11:37:13 ⮀ ~ ⮀ netstat -a | grep postgres
  tcp6       0      0  *.postgres             *.*                    LISTEN
  tcp4       0      0  *.postgresql           *.*                    LISTEN
  </code></pre>
  
  <p>It says nothing running on <code>port 5432</code>
  What am I missing?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>My <code>pg_hba.conf</code> looks like</p>
  
  <pre><code># TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     md5
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            md5
  # IPv6 local connections:
  host    all             all             ::1/128                 md5
  </code></pre>