Background Jobs in PostgreSQL
There are lots of ways to run a scheduled job. One of them is using pgAgent. 
For windows you can store your password in %APPDATA%\postgresql\pgpass.conf file. Here you can find details. You can also add trust to specific ip and user from server side by changing pg_hba.conf file