remote connection into postgres db / summary report

remote connection into postgres db / summary report

our organization has a need to provide data for how many password changes, resets, unlocks were handled monthly.  how can we configure the postgres db running on the selfservice so that we can log in remotely to run a query?

alternatively, can manageengine create the report internal to the application that we can schedule the report -

the report would look something like:

 Month/Year |      Type       | Count 
------------+-----------------+-------
 mm/yyyy   | Change Password |  ####
 mm/yyyy    | Reset Password  |   ####
 mm/yyyy   | Unlock Account  |   ####
(3 rows)

  Month  | New Users 
---------+-----------
 mm/yyyy |       ###
(1 row)

 Total Users 
-------------
        ####