title: psql: FATAL: Peer authentication failed for user "trifacta" and Ident authentication failed for user
body: <p>When I try to login to postgres I get the following error:</p>
  
  <pre><code># psql -U trifacta -h 127.0.0.1 trifacta
  psql: FATAL:  Ident authentication failed for user "trifacta"
  
  # psql -d trifacta -U trifacta -w
  psql: FATAL:  Peer authentication failed for user "trifacta"
  </code></pre>
  
  <p>I have added trifacta user into pg_hba.conf. below is the pg_hba.conf script</p>
  
  <pre><code>local trifacta trifacta md5
  host trifacta trifacta 127.0.0.1/32 md5
  host trifacta trifacta ::1/128 md5
  
  # Entries for trifactaactiviti user
  
  local trifacta-activiti trifactaactiviti md5
  host trifacta-activiti trifactaactiviti 127.0.0.1/32 md5
  host trifacta-activiti trifactaactiviti ::1/128 md5
  
  
  ###### TRIFACTA ENTRIES - END ######
  
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     md5
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            md5
  # IPv6 local connections:
  host    all             all             ::1/128                 md5
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ysUdV.jpg" rel="nofollow noreferrer">list of roles and dbs</a></p>
  
  <p>I have tested by changing md5 to peer and trust and still had the same issue. I don't know what else I can try here. </p>
  
  <p>Any help is appreciated.</p>
  
  <p>Thanks in advance</p>