How can I execute a procedure like SELECT my_proc() inside my POSTGRESQL database using Windows Task Scheduler? Is it possible to make a script to call my procedure every 5 minutes? If it's possible I need one.
I can't use pgAgent in my environment, sorry guys!
Any tips?
Use Task Scheduler to run psql on the desired schedule, with a command like:
psql -U username -d databasename -w -c 'SELECT my_procedure()'
and put the password in your .pgpass file, or set a PGPASS environment variable in the task.
You don't need any kind of script unless you want to do command specific error handling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With