On this page
Warning:
GA releases for CockroachDB v23.1 are no longer supported. Cockroach Labs will stop providing LTS Assistance Support for v23.1 LTS releases on November 13, 2025. Prior to that date, upgrade to a more recent version to continue receiving support. For more details, refer to the Release Support Policy.
The DROP SCHEDULES
statement can be used to remove backup schedules or changefeed schedules.
When DROP SCHEDULES
removes a full backup schedule, it removes the associated incremental backup schedule, if it exists.
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
The following users can drop a schedule:
- Members of the
admin
role. By default, theroot
user belongs to theadmin
role. - Owners of a backup schedule, i.e., the user that created the backup schedule.
- Owners of a changefeed schedule, i.e., the user that created the changefeed schedule.
Synopsis
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 WITH x AS (SHOW SCHEDULES) SELECT id FROM x WHERE label = 'schedule_database';
DROP SCHEDULES 4
In this example, all schedules with the label schedule_database
are dropped.