add_job() Community
Register an action to be scheduled by our automation framework. Please read the instructions for more details including multiple example actions.
Required Arguments
Name | Description |
---|---|
proc | (REGPROC) Name of the function or procedure to register as job |
schedule_interval | (INTERVAL) Interval between executions of this job |
Optional Arguments
Name | Description |
---|---|
config | (JSONB) Job-specific configuration (this will be passed to the function when executed) |
initial_start | (TIMESTAMPTZ) Time of first execution of job |
scheduled | (BOOLEAN) Set to FALSE to exclude this job from scheduling. Defaults to TRUE . |
Returns
Column | Description |
---|---|
job_id | (INTEGER) TimescaleDB background job id |
Sample Usage
CREATE OR REPLACE PROCEDURE user_defined_action(job_id int, config jsonb) LANGUAGE PLPGSQL AS
$$
BEGIN
RAISE NOTICE 'Executing action % with config %', job_id, config;
END
$$;
SELECT add_job('user_defined_action','1h');
Register the procedure user_defined_action
to be run every hour.
当前内容版权归 TimescaleDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 TimescaleDB .