문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top