title: PostgreSQL Connection Refused
body: <p>I have installed PostgreSQL. However everytime I try to connect through PGAdmin or through psql it gives me the below error.</p>
  
  <pre class="lang-sql prettyprint-override"><code>could not connect to server: Connection refused (0x0000274D/10061) 
        Is  the server running on host "localhost" (::1) and 
        accepting TCP/IP  connections on port 5432? 
  could not connect to server: Connection  refused (0x0000274D/10061) 
        Is the server running on host "localhost" (127.0.0.1) and 
        accepting TCP/IP connections on port 5432?
  </code></pre>
  
  <p>I checked the <code>postgresql.conf</code> file and the line: <code>listen_addresses = '*'</code> isn't commented out.</p>
  
  <p>Also this is how my <code>pg_hba.conf</code> file is set:</p>
  
  <pre class="lang-sql prettyprint-override"><code># IPv4 local connections:
    host    all             all             127.0.0.1/32            trust
  # IPv6 local connections:
    host    all             all             ::1/128                 trust
  </code></pre>
  
  <p>Can anyone please advise on how I can resolve this issue?</p>
  
  <p>Thanks!</p>