<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head><body><p>I have lost/forgotten the postgres password for my installation so I did the following.</p><p>I edited pg_hba.conf and added an entry:</p><p> local all all trust</p><p>restarted postgresql. </p><p>loged in as postgres (psql template1 -U postgres) </p><p>change the postgres password with</p><p>ALTER ROLE postgres PASSWORD foo</p><p>I edited pg_hba.conf and get rid of the added line</p><p>restarted postgres</p><p>when I attempted to reenter with </p><p> psql template1 -U postgres --password<br></p><p>I get an error Peer authentication failed for user "postgres"</p><p><br></p><p>Not sure what I did wrong, any help would be appreciated. </p></body></html>