Good day.
I have a PostgreSQL server.
Once i had admin login and password, then i created a new login for web application (with low permissions like select form some tables etc). And i just lost my admin login and password.
I have access (administator) to host where the server is running. Server is windows 2008 server.
Is there any way to recover admin permissions? May be i somehow could create another superuser?
Best Answer
This is easy to fix. Edit
pg_hba.conf
to add a line like this:(You may need to restart Postgres server after editing it).
Then, use this:
You should be able to get admin access without password now (that's why you added
trust
rule topg_hba.conf
).Once this command works, change your password:
After doing this, edit
pg_hba.conf
to remove line you added.