how to check and reset NA postgres password in windows platform 10.30
Dear NA experts ,
i want to check and reset NA postgres db password from windows platform 10.30 NA .
kindly provide the suggestion for the same .
we are using NA standalone server with NA postgres database .and we want to upgrade NA and i need password postgres database .
Yes, there is a way to change the superuser password of a postgres database, it would be as follows.
Go to the postgres installation folder and find the file pg_hba.conf, create a copy or a backup of this file changing the name, now, in the file "original" add the line local all all trust, this after the commented lines of the file. (Commented means with # at the beginning).
Now restart your postgres database service.
If the postgres service does not start you must change the added line to the following. host all all 127.0.0.1/32 trust
After these changes you should be able connect with any user of the database as a postgres superuser.
To reset the password you have to connect to the database directly by going to its binaries and using the command psql -U [Database user] here you use the query
ALTER USER [User logged in the database] with password '[New password]';
Now for security it would be ideal to restore the pg_hba.conf file since you should not have access as superuser to any user. After doing this you restart the services again and connect with the changed user of the database.
This in the same way you can look for it in the following links so that you have more references and there are no problems understanding the process to follow.