title: what value to set in postgresql.conf to enable use of "localhost" and "127.0.0.1" and ip address?
body: <p>In order to be able to connect to my postgresql database from another machine, I had to configure my postgresql.conf file like so: </p>
  
  <pre><code>#------------------------------------------------------------------------------
  # CONNECTIONS AND AUTHENTICATION
  #------------------------------------------------------------------------------
  
  # - Connection Settings -
  
  listen_addresses = '10.14.4.4'                # what IP address(es) to listen on;
                                          # comma-separated list of addresses;
                                          # defaults to 'localhost'; use '*' for all
                                          # (change requires restart)
  port = 5432                             # (change requires restart)
  </code></pre>
  
  <p>I tried using 127.0.0.1 but that didn't work.  Neither did "localhost".  The only way I was able to do make this work is to use the actual IP address of the server.  I checked to make sure in my "hosts" file, localhost was defined....</p>
  
  <p>In any case, I am now able to connect from a different server by doing the following: </p>
  
  <pre><code>psql -U test test -h 10.14.4.4
  </code></pre>
  
  <p>But now I'm noticing that I cannot log on <strong>locally</strong> using the following syntax:</p>
  
  <pre><code>psql -U test test -h 127.0.0.1
  </code></pre>
  
  <p>The only way to log in locally is </p>
  
  <pre><code>psql -U test test
  </code></pre>
  
  <p>I tried to change my postgresql.conf file to use "*"... and that let's me log in remotely, but locally, i still cannot use 127.0.0.1 or "localhost" to connect. </p>
  
  <p>How can I set this up so that both my remote log ins and my local log ins work? </p>
  
  <p>Thanks.</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>Here's what my pg_hba.conf file looks like: </p>
  
  <pre><code># TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     trust
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            trust
  # IPv6 local connections:
  host    all             all             ::1/128                 trust
  # Allow replication connections from localhost, by a user with the
  # replication privilege.
  #local   replication     postgres                                trust
  #host    replication     postgres        127.0.0.1/32            trust
  #host    replication     postgres        ::1/128                 trust
  host    all             all             10.14.4.0/24 trust
  host    replication     postgres        10.14.0.0/16              trust
  </code></pre>