Create your user which it appears you already have but confirm using the \du or \dg commands:
Code:
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
test | Superuser, Create role, Create DB, Replication | {}
Make sure you set a secure password for your new user:
Code:
postgres=# ALTER ROLE test ENCRYPTED PASSWORD 'test123';
ALTER ROLE
**WARNING**
Entering a password in plain text as shown above is not recommended because it's stored in .psql_history file. There's a secure psql command that allows you to do this but I don't remember it.
Now just logout with \q from pgsql client and attempt to login as your new user...
Code:
cmennens@tuna:~$ psql -d postgres -U test -W
Password for user test:
psql (9.1.1)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.
postgres=#
If this doesn't work for you. The issue lies within your hba_conf file and make sure local connections are not set to 'peer' but rather 'md5'.
**EDIT**
To securely change a users password, I found this in the 'psql' man page:
Quote:
|
\password [USERNAME] securely change the password for a user
|
It's up to you how you prefer to alter a users password on your server...