1-
21-- Create a Job with the timetable.job_add function in cron style
32
43-- In order to demonstrate Cron style schduling of job execution, we will create a table(One time) for inserting of data
5- CREATE TABLE timetable .dummy_log (
4+ CREATE TABLE IF NOT EXISTS timetable .dummy_log (
65 log_ID BIGSERIAL ,
76 event_name TEXT ,
87 timestmp TIMESTAMPTZ DEFAULT TRANSACTION_TIMESTAMP(),
@@ -13,12 +12,7 @@ CREATE TABLE timetable.dummy_log (
1312-- task_function: The function wich will be executed.
1413-- client_name: The name of worker under which this task will execute
1514-- task_type: Type of the function SQL,SHELL and BUILTIN
16- -- by_cron: Time Schedule in Cron Syntax
17- -- by_minute: This specifies the minutes on which the job is to run
18- -- by_hour: This specifies the hours on which the job is to run
19- -- by_day: This specifies the days on which the job is to run.
20- -- by_month: This specifies the month on which the job is to run
21- -- by_day_of_week: This specifies the day of week (0,7 is sunday) on which the job is to run
15+ -- run_at: Time Schedule in Cron Syntax
2216-- max_instances: The amount of instances that this chain may have running at the same time.
2317-- live: Control if the chain may be executed once it reaches its schedule.
2418-- self_destruct: Self destruct the chain.
@@ -38,12 +32,7 @@ SELECT timetable.job_add (
3832 task_function => $$INSERT INTO timetable .dummy_log (event_name) VALUES (' Cron test' )$$,
3933 client_name => NULL , -- any worker may execute
4034 task_type => ' SQL' ,
41- by_cron => ' 40 */2 27 * *' ,
42- by_minute => NULL ,
43- by_hour => NULL ,
44- by_day => NULL ,
45- by_month => NULL ,
46- by_day_of_week => NULL ,
35+ run_at => ' 40 */2 27 * *' ,
4736 max_instances => 1 ,
4837 live => TRUE,
4938 self_destruct => FALSE);
0 commit comments