How to query the database from windows command line ?

How to query the database from windows command line ?

Our toast user addition process is when we add user to an existing AD group, user becomes a toast user and gets autheticated by the AD server when he/she needs to login. 
User deletion on the other hand is manual. It is a one way street for AD. 
Being the admin for a very large corporation, I am getting emails about newly departed employees daily, to review and if necessary delete them from Toast. Line count of the said list exceed 100 in some days.
Although the number of users to be delete is too few and can be managed manually, searching for every departed user in the toast interface one by one, takes up a considerable amount of time. 

I was wondering if there is a database query that can be run with a given user's name (or partial name) ans see if the name matches any line on toast database. If it does, I can take care of deletion manually. Looks like our implementation's back end is postgres datbase. If someone can tell me how to do this, I'd greatly appreciate

                New to ADManager Plus?

                  New to ADSelfService Plus?