How to reset PostgreSQL database password for SoftActivity software

By default, SoftActivity uses the following user name for Postgres database: softactivity
Admin password for the database is the same as set by the administrator during SoftActivity product installation.
By default, connections to the database only can be made from a local computer where PostgreSQL server is installed.

*  These instructions also apply in general to resetting PostgreSQL password, not as a part of SoftActivity system, with the only difference in the service name with the version number: postgresql-9.6

To reset PostgreSQL database password in SoftActivity product, follow these steps:

  1. Open Database tab in TS Monitor or Activity Monitor settings, click Check Connection to verify connection settings:
  2. Try the password used to open Activity Monitor or TS Monitor. If it’s still not accepted, you can reset the password for the database.
  3. Click About tab, click PostgreSQL config files link to open the database’s pgdata folder.
  4. Back up pg_hba.conf there found there.
  5. Open pg_hba.conf file in Notepad, find the following lines:
    host all all md5
    host all all ::1/128 md5

    and replace with:

    host all all trust
    host all all ::1/128 trust

    Note: Uncomment the lines if needed by removing a leading # character.

    Warning: this modification allows any user to connect to the database from the local computer without any password authentication! These lines must be reverted or commented out later!

  6. Restart PostgreSQL server by restarting SapgSrv service in Windows Services or from Command Line:
    sc stop SapgSrv
    sc start SapgSrv

    Make sure that SapgSrv service has started and is in Running state. If pg_hba.conf file has been incorrectly formatted after editing, the service might not start. Check Event Log for error messages from PostgreSQL source

  7. Open Command Prompt in this folder:
    "C:\Program Files\SoftActivity\Activity Monitor\postgres\bin" or
    "C:\Program Files\SoftActivity TS Monitor\postgres\bin"
  8. Run from Command line:
    psql -h localhost -U softactivity -d postgres
    ,where softactivity: user name used for connection
    postgres – database name
    This command should not ask for password and will connect you to the database from the command line.
  9. Enter the following command that changes the password for user softactivity (replace my_secure_password with an actual unique and strong password):
    ALTER USER softactivity with password 'my_secure_password';
    and press Enter to execute.
    Note: make sure you don’t miss ; character at the end
    Type \q and press Enter to exit psql
  10. Important: Restore pg_hba.conf to its original state, restart SapgSrv
  11. Enter your new password on Database tab in Settings and click Check Connection to verify that it’s accepted now.