I'm running a cron job using pg_cron.
The job is running some cleanup queries, that occasionally takes longer to complete.
When that happens, the job fails on statement timeout of 2 min which is the default
ERROR: canceling statement due to statement timeout
I'd like to increase the statement_timeout for this job.
set statement_timeout='1200s'
select do_cleanup_tasks()
What would be the scope of this statement timeout change? Will it effect only the execution of this transaction, or it has a wider effect?