title: psql: fe_sendauth: no password supplied with pgpass
body: <p>I am trying to connect to the PostgreSQL-11 using psql-11 and pgpass as I want to avoid password request.</p>
  <p>I used following post: <a href="https://stackoverflow.com/questions/9736085/run-a-postgresql-sql-file-using-command-line-arguments">Run a PostgreSQL .sql file using command line arguments</a>. I checked other resources but wasn't able to identify issue.</p>
  <p>Content of <strong>~/.pgpass</strong> (chmod 0600)</p>
  <pre><code>*:*:*:postgres:postgres
  </code></pre>
  <p>Content of <strong>pg_hba.conf</strong></p>
  <pre><code># TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # &quot;local&quot; 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     all                                     trust
  host    replication     all             127.0.0.1/32            trust
  host    replication     all             ::1/128                 trust
  </code></pre>
  <p>I am using following command to connect to the Database:</p>
  <pre><code>psql -U postgres -h 10.20.110.43 -p 5432 -d PostgreDB -w
  </code></pre>
  <p>It is working when I am excluding <strong>-w</strong>, but in this case I have to type in a password.
  I also can see that <strong>pgpass</strong> will be checked, as when I am using wrong permissions system ask me to change it to 0600.</p>
  <p>Thanks for your help!</p>