We want to alert on failing cron jobs. But robot_zmon user has no rights to query tables cron.job and cron.job_run_details. Even when granted USAGE and SELECT, the details are protected by a row level policy. Therefore, the PR suggests to add a wrapper function with SECURITY DEFINER to allow the invoker to list the last status of active cron jobs.
We want to alert on failing cron jobs. But
robot_zmon
user has no rights to query tables cron.job and cron.job_run_details. Even when granted USAGE and SELECT, the details are protected by a row level policy. Therefore, the PR suggests to add a wrapper function with SECURITY DEFINER to allow the invoker to list the last status of active cron jobs.