On this page
Warning:
CockroachDB v20.2 is no longer supported as of May 10, 2022. For more details, refer to the Release Support Policy.
New in v20.2: The DROP SCHEDULES
statement can be used to remove backup schedules.
Warning:
DROP SCHEDULE
does not cancel any in-progress jobs started by the schedule. Before you drop a schedule, cancel any in-progress jobs first, as you will not be able to look up the job ID once the schedule is dropped.
Required privileges
Only members of the admin
role can drop a schedule. By default, the root
user belongs to the admin
role.
Synopsis
DROP SCHEDULES <selectclause>
select clause: select statement returning schedule id to pause.
DROP SCHEDULE <scheduleID>
Parameters
Parameter | Description |
---|---|
selectclause |
A selection query that returns id (s) to drop. |
scheduleID |
The id of the schedule you want to drop, which can be found with SHOW SCHEDULES . |
Examples
Drop a schedule
> DROP SCHEDULE 589963390487363585;
DROP SCHEDULES 1
Drop multiple schedules
To drop multiple schedules, nest a SELECT
clause that retrieves id
(s) inside the DROP SCHEDULES
statement:
> DROP SCHEDULES SELECT id FROM [SHOW SCHEDULES] WHERE label = 'schedule_database';
DROP SCHEDULES 4
In this example, all schedules with the label schedule_database
are dropped.