title: Postgresql: Unable to connect through psql at console to default localhost
body: <p>Postgresql server running and verified on 5432 on my localhost system:</p>
  
  <p>If I type: <code>psql -l</code> I get the following response:</p>
  
  <blockquote>
    <p>psql: could not connect to server: No such file or directory<br>
    Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?</p>
  </blockquote>
  
  <p>If I type <code>psql -h localhost -l</code>, it works and gives me a list of the databases.</p>
  
  <p>The <code>pg_hba.conf</code> file is wide open, showing:</p>
  
  <pre><code>TYPE    DATABASE        USER            ADDRESS                 METHOD
  </code></pre>
  
  <p>The value "local" is for Unix domain socket connections only:</p>
  
  <pre><code>local   all             all                                     trust
  </code></pre>
  
  <p>Allow any IP to connect without password:</p>
  
  <pre><code>host    all             all             0.0.0.0/0               trust
  </code></pre>
  
  <p>IPv4 local connections:</p>
  
  <pre><code>host    all             all             127.0.0.1/32            trust
  </code></pre>
  
  <p>IPv6 local connections:</p>
  
  <pre><code>host    all             all             ::1/128                 trust
  </code></pre>
  
  <p>What have I missed? On other systems the first call from the command line works fine.</p>