You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API function cron.unschedule has two overloaded versions - one takes a jobid, the other takes a jobname.
The one taking jobid unschedules the job without looking at the current user column. As a result, one user can unschedule jobs created by another user so long as row level security rules allow for record visibility.
But, the version of cron.unschedule function that takes a job name behaves differently.
It filters for jobs started by current user (source) and reports that task was not found if the task with the passed name was started by another user.
SET ROLE some_non_superuser;
SELECTcron.schedule('some_name', '1 second', $$SELECT1$$) as some_name_jobid \gset
SET ROLE some_superuser;
\set ON_ERROR_STOP off
SELECTcron.unschedule('some_name'); --fails
\set ON_ERROR_STOP onSELECTcron.unschedule(:some_name_jobid); --succeeds
The fix probably is to delete the mentioned lines above, or add them in cron_schedule, depending on intended API.
The text was updated successfully, but these errors were encountered:
Ngalstyan4
added a commit
to lanterndata/lantern
that referenced
this issue
Apr 17, 2024
- Grant necessary permissions to pg_cron resources and lantern.tasks
table
- Refactor pg_cron unscheduling logic to bypass pg_cron unscheduling
related issue: citusdata/pg_cron#320citusdata/pg_cron#320
- Grant necessary permissions to pg_cron resources and lantern.tasks
table
- Refactor pg_cron unscheduling logic to bypass pg_cron unscheduling
related issue: citusdata/pg_cron#320citusdata/pg_cron#320
The API function
cron.unschedule
has two overloaded versions - one takes ajobid
, the other takes ajobname
.The one taking
jobid
unschedules the job without looking at the current user column. As a result, one user can unschedule jobs created by another user so long as row level security rules allow for record visibility.But, the version of
cron.unschedule
function that takes a job name behaves differently.It filters for jobs started by current user (source) and reports that task was not found if the task with the passed name was started by another user.
The fix probably is to delete the mentioned lines above, or add them in
cron_schedule
, depending on intended API.The text was updated successfully, but these errors were encountered: