- ALTER USER postgres WITH PASSWORD '<new password>';
Additionally for altering "sdpadmin" password,
- ALTER USER sdpadmin WITH PASSWORD '<new password>';
g. Now close the postgres console using the command "\q"
h. Stop the database server by executing " stopDB " script under <<Product_Installation_Directory> \ bin.
i. Revert the changes done in pg_hba.conf. (i-e: change authentication method back to md5).
If you start the server the next time, you need to enter the new password you have configured in the PostgreSQL database.
section 2 : Updating the database user password into Product
As mentioned above we use these users to perform database operations integrated with our product. Hence it is vital to update the password into the product when you changed any of these database users password. However, the way of updating the password into the application differs with respect to the users.
case I : Updating the password of "sdpadmin"
a. Navigate to <Product_Installation_Directory> \ bin.
b. Execute changeDBServer script from this directory
c. Enter the password of sdpadmin in the changeDBServer wizard > password field
case II : Updating the password of "postgres"
a. Navigate to <Product_Installation_Directory> \ bin directory and Start the database by invoking "startDB" script.
b. Navigate yourself to <Product_Installation_Directory> \ conf directory and check the encryption algorithm value specified in the product-config.xml file. The value will be specified as below, inside the xml file, under postgres configuration :
<property name="encryption.algo" value="aes256"/>
Here in this case, it is specified as "aes256". Note down this algorithm value.
c. Navigate to <Product_Installation_Directory> \ pgsql \ bin directory
d. Connect to postgres console as the sdpadmin user with the following command and enter the configured password when prompted
./psql -h 127.0.0.1 -p 65432 -d servicedesk -U sdpadmin
e. Execute the below query, by substituting the algorithm value noted above and the password you have configured for postgres.
UPDATE DBCredentialsAudit set password=pgp_sym_encrypt('<password configured for postgres user>','SChar@123Mas!er','s2k-mode=1, cipher-algo=<algorithm value>') where username='postgres';
f. Now close the postgres console using the command "\q"
g. Stop the database server by executing "stopDB " script under <Product_Installation_Directory> \ bin.
Now the password of the postgres users are altered and successfully updated in the Application. Now you can start the application and proceed with your production.