I created a user like this:
create user blog with password 'blog';
Then I made it the owner of a database:
alter database blog_development owner to blog;
Then I tried to log in and it didn't work:
$ psql -d blog_development -U blog -W
Password for user blog:
psql: FATAL: Ident authentication failed for user "blog"
Any idea why?
One thing I've tried is editing pg_hba.conf
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
Line 85 is the one I added. I restarted PostgreSQL after that but it didn't seem to change anything.
pg_hba.conf) but I still can't log in from the command line.