title: PostgreSQL: Remotely connecting to Postgres instance using psql command
body: <p>I want to remotely connect to a Postgres instance. I know we can do this using the psql command passing the hostname</p>
  
  <p>I tried the following:</p>
  
  <pre><code>psql -U postgres -p 5432 -h hostname
  </code></pre>
  
  <p>I modified the /etc/postgresql/9.3/main/pg_hba.conf file on the target machine to allow remote connections by default</p>
  
  <p>I added the following line to the file </p>
  
  <pre><code>host all all source_ip/32 trust
  </code></pre>
  
  <p>I restarted the cluster using </p>
  
  <pre><code>pg_ctlcluster 9.2 mycluster stop
  pg_ctlcluster 9.2 mycluster start
  </code></pre>
  
  <p>However, when I try to connect from the source_ip, I still get the error </p>
  
  <blockquote>
    <p>Is the server running on host "" and accepting TCP/IP connections on port 5432?</p>
  </blockquote>
  
  <p>What am I doing wrong here?</p>