Alter and delete user-defined actions
Alter an existing job by using alter_job. You can change both the config and the schedule on which the job runs. Delete a job by using delete_job.
note
To alter or delete a job, you need to know its job_id
. Find the job_id
by querying the timescaledb_information.jobs
table.
SELECT * FROM timescaledb_information.jobs;
Change a job’s config
To replace the entire JSON config for a job, call alter_job
with a new config
object. For example, for a job with id 1000
:
SELECT alter_job(1000, config => '{"hypertable":"metrics"}');
Turn off scheduling of a job
To turn off automatic scheduling of a job, call alter_job
and set scheduled
to false
. You can still run the job manually with run_job
. For example, for a job with id 1000
:
SELECT alter_job(1000, scheduled => false);
Re-enable automatic scheduling of a job
To re-enable automatic scheduling of a job, call alter_job
and set scheduled
to true
. For example, for a job with id 1000
:
SELECT alter_job(1000, scheduled => true);
Delete a job
Delete a job from the automation framework with delete_job. For example, for a job with id 1000
:
SELECT delete_job(1000);