title: Can't log into PostgreSQL database
body: <p>I created a user like this:</p>
  
  <pre><code>create user blog with password 'blog';
  </code></pre>
  
  <p>Then I made it the owner of a database:</p>
  
  <pre><code>alter database blog_development owner to blog;
  </code></pre>
  
  <p>Then I tried to log in and it didn't work:</p>
  
  <pre><code>$ psql -d blog_development -U blog -W
  Password for user blog:
  psql: FATAL:  Ident authentication failed for user "blog"
  </code></pre>
  
  <p>Any idea why?</p>
  
  <p>One thing I've tried is editing <code>pg_hba.conf</code></p>
  
  <pre><code> 76 # Database administrative login by UNIX sockets
   77 local   all                postgres                          ident
   78
   79 # TYPE  DATABASE           USER        CIDR-ADDRESS          METHOD
   80
   81 # "local" is for Unix domain socket connections only
   82 local   all                all                               ident
   83 # IPv4 local connections:
   84 host    all                all         127.0.0.1/32          md5
   85 host    blog_development   blog        127.0.0.1/32          md5
   86 # IPv6 local connections:
   87 host    all                all         ::1/128               md5
  </code></pre>
  
  <p>Line 85 is the one I added. I restarted PostgreSQL after that but it didn't seem to change anything.</p>