PostgreSQL: Using the .pgpass file

I have been reading up on the .pgpass file, but I can’t get it working for me.

My .pgpass file looks something like this: 

I set the privilege to 0600 (this is on CentOS Linux) and try:


Where I get the message:

psql: error: FATAL: database "…" does not exist

where is my user name.

I can successfully connect if I use:

psql -u … -d accounts 

so I don’t think my .pgpass file is doing its job.

How can I get it to work?