ALTER SCHEDULE
Modifies a schedule.
Modifies a schedule.
Syntax
ALTER SCHEDULE [[database.]schema.]schedule {
OWNER TO new_owner
| SET SCHEMA new_schema
| RENAME TO new_schedule
| USING CRON new_cron_expression
| USING DATETIMES new_timestamp_list
}
Parameters
[
database
.]
schema
Database and schema. The default schema is
public
. If you specify a database, it must be the current database.schedule
- The schedule to modify.
new_owner
- The new owner of the schedule.
new_schema
- The new schema of the schedule.
new_schedule
- The new name for the schedule.
new_cron_expression
- A
cron
expression. For example, to execute every day at 1:00PM:=> ALTER SCHEDULE sched1 USING CRON '0 13 * * *';
new_timestamp_list
- A comma-separated list of timestamps. For example, to execute at noon on October 2nd and November 2nd 2022:
=> ALTER SCHEDULE sched2 USING DATETIMES('2022-10-02 12:00:00', '2022-11-02 12:00:00');
Privileges
Superuser
Examples
To change the cron
expression for a schedule:
=> ALTER SCHEDULE daily_schedule USING CRON '0 8 * * *';
To change a schedule that uses a cron
expression to use a timestamp list instead:
=> ALTER SCHEDULE my_schedule USING DATETIMES('2023-10-01 12:30:00', '2022-11-01 12:30:00');
To rename a schedule:
=> ALTER SCHEDULE daily_schedule RENAME TO daily_8am_gmt;