Try this:
Open PgAdmin -> Files -> Open pgpass.conf
You would get the path of pgpass.conf
at the bottom of the window.
Go to that location and open this file, you can find your password there.
Reference
If the above does not work, you may consider trying this:
- Edit
pg_hba.conf
to allow trust authorization temporarily - Reload the config file (
pg_ctl reload
) - Connect and issue
ALTER ROLE / PASSWORD
to set the new password - Edit
pg_hba.conf
again and restore the previous settings - Reload the config file again