title: PostgreSQL: role is not permitted to log in
body: <p>I have trouble connecting to my own postgres db on a local server.
  I googled some similar problems and came up with this manual
  <a href="https://help.ubuntu.com/stable/serverguide/postgresql.html">https://help.ubuntu.com/stable/serverguide/postgresql.html</a></p>
  
  <p>so:</p>
  
  <p><code>pg_hba.conf</code> says:</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            md5
  # IPv6 local connections:
  host    all             all             ::1/128                 trust
  </code></pre>
  
  <p>then I create a user and assign a password for it:</p>
  
  <pre><code>postgres=# create role asunotest;
  CREATE ROLE
  postgres=# alter role asunotest with encrypted password '1234';
  ALTER ROLE
  </code></pre>
  
  <p>but it doesn't let me in:</p>
  
  <pre><code>-bash-4.2$ psql -h 127.0.0.1 -U asunotest
  Password for user asunotest: 1234
  psql: FATAL:  role "asunotest" is not permitted to log in
  </code></pre>
  
  <p>what could be the problem?</p>