RT Cannot Connect to Local PostgreSQL Service with postgres User

  1. trust connection by adding in pg_hba.conf file
  • local all postgres trust
  1. Restart postgresql service
  • sudo service postgresql restart
  1. psql -U postgres
  2. At the postgres=# prompt, change the user name postgres password:
  • ALTER USER postgres with password ‘new-password’;
  1. Revert the changes in pg_hba.conf file from trust to md5 and restart postgresql
    yet when i try to test psql -U postgres -W
    it will give me this error:
    [root@localhost rt-4.4.3]# psql -U postgres -W
    Password for user postgres:
    psql: FATAL: Peer authentication failed for user “postgres”
    [root@localhost rt-4.4.3]#
    pls how can i go about this?