0

I forgot my password for an older version of Postgres (I believe v14) and uninstalled it then deleted the remaining files in my program files folder.

I also deleted the environment variable in the path leading to it.

I installed the latest version, v15. I set the path variable to include C:\Program Files\PostgreSQL\15\bin

v15 works perfectly fine. When I do psql -U postgres I can log in.

None of my passwords work for it, I get

psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL:  password authentication failed for user "chris"

However, simply typing psql in the Power Shell asks me for an old user, of which I forgot the password (the above user, "chris").

PgAdmin does not have this user listed, nor any databases associated with it, only the new Postgres user with v15.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263

1 Answers1

1

There probably is no user chris in your new v15 cluster. You'd have to create it:

psql -U postgres
...
postgres#> CREATE ROLE chris LOGIN;
CREATE USER
postgres#> \password chris
Enter new password for user "chris": 
Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • Unfortunately, I've tried this. When I add a new user and a new password I still get wrong password for the 'chris' account that was previously created. – Timothy W. Times Jan 13 '23 at 02:35
  • 1
    If the user already exists, then only change its password. – Laurenz Albe Jan 13 '23 at 06:35
  • Awesome, it worked. Weird that when I created a new "chris" user and set the password it was coming back as wrong password still. When I removed the new chris user for V15 and then did the steps you mentioned it worked. I appreciate your assistance! – Timothy W. Times Jan 14 '23 at 05:32