title: Psycopg2 reporting pg_hba.conf error
body: <p>I've run into a weird situation while trying to use PostgreSQL and Psycopg2. For some reason, every time I attempt to connect to the postgre database via python, I get the following error:</p>
  
  <pre><code>psycopg2.OperationalError: FATAL:  no pg_hba.conf entry for host "127.0.0.1", user "steve", database "steve", SSL on
  FATAL:  no pg_hba.conf entry for host "127.0.0.1", user "steve", database "steve", SSL off
  </code></pre>
  
  <p>Naturally, I checked pg_hba.conf to see what the issue was, but everything appeared to be configured correctly as far as I can see:</p>
  
  <p><strong>pg_hba.conf:</strong></p>
  
  <pre><code># TYPE  DATABASE        USER            CIDR-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>
  
  <p>In addition, I've found that I can connect to the database via psql as I would expect:</p>
  
  <pre><code>$ psql -U steve -h 127.0.0.1
  ...
  steve=&gt;
  </code></pre>
  
  <p>Anyone have any ideas as to what could be going on here? Thanks in advance!</p>