36
36
<itemizedlist>
37
37
<listitem>
38
38
<para>
39
- With <filename>pgpro_scheduler</filename> enabled, any user can
39
+ Any user can
40
40
schedule jobs independently.
41
41
</para>
42
42
</listitem>
56
56
</listitem>
57
57
<listitem>
58
58
<para>
59
- Each database has its own " supervisor" scheduler, with each
59
+ Each database has its own <quote> supervisor</quote> scheduler, with each
60
60
scheduled job executed by a separate background worker for
61
61
enhanced stability.
62
62
</para>
74
74
<filename>pgpro_scheduler</filename>:</para>
75
75
<orderedlist>
76
76
<listitem>
77
- <para>Modify the <filename>postgresql.conf</filename> file by adding
78
- <filename>pgpro_scheduler</filename> to the
79
- <varname>shared_preload_libraries</varname> variable:
77
+ <para>Add <filename>pgpro_scheduler</filename> to the
78
+ <varname>shared_preload_libraries</varname> variable in the <filename>postgresql.conf</filename> file:
80
79
<programlisting>
81
80
shared_preload_libraries = 'pgpro_scheduler'
82
81
</programlisting></para>
@@ -305,8 +304,8 @@ For details, see <xref linkend="schedule-create-job"> function description.</par
305
304
<emphasis role="strong">Examples:</emphasis>
306
305
</para>
307
306
<para>
308
- To run the job every day at 3 pm , and, additionally, on December
309
- 31, 2017 at 7 pm , and on April 4, 2020 at 1 pm :
307
+ To run the job every day at 3pm , and, additionally, on December
308
+ 31, 2017 at 7pm , and on April 4, 2020 at 1pm :
310
309
</para>
311
310
<programlisting>
312
311
SELECT schedule.create_job('{"commands": "SELECT 15", "cron": "0 15 * * *", "dates": [ "2017-12-31 19:00", "2020-04-04 13:00" ]}');
@@ -326,7 +325,7 @@ SELECT schedule.create_job('{"commands": "SELECT pg_sleep(100)&qu
326
325
ensure that <filename>pgpro_scheduler</filename> only executes
327
326
the job within the specified time window, define the
328
327
<literal>start_date</literal> and <literal>end_date</literal>
329
- keys, in the timestamp with time zone format. You can set one
328
+ keys, in the <type> timestamp with time zone format</type> . You can set one
330
329
of these keys only to limit the start or the end time,
331
330
respectively. If you define a time window for the job,
332
331
<filename>pgpro_scheduler</filename> will only schedule this job
@@ -344,8 +343,8 @@ SELECT schedule.create_job('{"commands": "SELECT now()", &qu
344
343
</programlisting>
345
344
</para>
346
345
<para>
347
- To schedule the job in the timeframe from 11am on May 1 till
348
- 15pm on June 4, 2017:
346
+ To schedule the job in the timeframe from 11am on May 1 to
347
+ 3pm on June 4, 2017:
349
348
<programlisting>
350
349
SELECT schedule.create_job('{"commands": "SELECT now()", "cron": "2 17 * * *", "start_date": "2017-05-01 11:00", "end_date": "2017-06-04 15:00" }');
351
350
</programlisting>
@@ -367,7 +366,7 @@ SELECT schedule.create_job('{"commands": "SELECT now()", &qu
367
366
<emphasis role="strong">Examples:</emphasis>
368
367
</para>
369
368
<para>
370
- To run the whole job in the same transaction:
369
+ To run the whole job in a single transaction:
371
370
</para>
372
371
<programlisting>
373
372
SELECT schedule.create_job('{"commands": "SELECT 1; SELECT 2; SELECT 3;", "cron": "23 23 */2 * *" }');
@@ -379,7 +378,7 @@ SELECT schedule.create_job('{"commands": [ "SELECT 1", "
379
378
</programlisting>
380
379
</para>
381
380
<para>
382
- To run the whole job in the same transaction when passing the
381
+ To run the whole job in a single transaction when passing the
383
382
commands as an array:
384
383
<programlisting>
385
384
SELECT schedule.create_job('{"commands": [ "SELECT 1", "SELECT 2", "SELECT 3" ], "cron": "23 23 */2 * *", "use_same_transaction": true }');
@@ -399,16 +398,16 @@ SELECT schedule.create_job('{"commands": [ "SELECT 1", "
399
398
After the job run completes,
400
399
<filename>pgpro_scheduler</filename> executes the <acronym>SQL</acronym> statement
401
400
in the <literal>next_time_statement</literal> key to calculate
402
- the next start time and returns the result, in the timestamp
403
- with time zone type. If the return value is of a different
401
+ the next start time and returns the result, in the <type> timestamp
402
+ with time zone type</type> . If the return value is of a different
404
403
type or an error occurs, <filename>pgpro_scheduler</filename>
405
404
marks the job as broken and cancels any further execution.
406
405
This process is repeated for each successive job run.</para>
407
406
<tip><para>When the job run
408
407
completes, <filename>pgpro_scheduler</filename> sets the
409
408
transaction status in the
410
409
<varname>schedule.transaction_state</varname> variable, in the
411
- string format. You can use this variable in your
410
+ <type>text</type> format. You can use this variable in your
412
411
<literal>next_time_statement</literal> to dynamically
413
412
calculate the next start time depending on the transaction
414
413
status. At the time of the
@@ -483,7 +482,7 @@ SELECT schedule.create_job('{"commands": "SELECT session_user&quo
483
482
</programlisting>
484
483
</para>
485
484
<para>
486
- To define a backup <acronym>SQL</acronym> command in case of a rollback:
485
+ To define a fallback <acronym>SQL</acronym> command in case of a rollback:
487
486
<programlisting>
488
487
SELECT schedule.create_job('{"commands": "SELECT ''zzz''", "cron": "55 */12 * * *", "on_rollback": "SELECT ''An error occurred''" }');
489
488
</programlisting>
@@ -494,11 +493,11 @@ SELECT schedule.create_job('{"commands": "SELECT ''zzz''", &
494
493
<title>Changing and Removing Scheduled Jobs</title>
495
494
<para>
496
495
When you create a new job with the
497
- <literal>create_job()</literal> function, the job is active and
498
- waiting for execution based on the specified schedule. Using the
496
+ <literal>create_job()</literal> function, the job becomes active and
497
+ waits for execution based on the specified schedule. Using the
499
498
job ID returned by the <function>create_job()</function> function,
500
499
you can change the scheduling settings or remove the job from
501
- the schedule altogether . To change the specified schedule for
500
+ the schedule. To change the specified schedule for
502
501
the jobs, use <function>set_job_attribute()</function> or
503
502
<function>set_job_attributes()</function> functions: </para>
504
503
<itemizedlist>
@@ -528,7 +527,7 @@ SELECT schedule.create_job('{"commands": "SELECT ''zzz''", &
528
527
</programlisting>
529
528
</para>
530
529
<para>
531
- In this case, you can re-activate the job later by running the
530
+ You can re-activate the job later by running the
532
531
<function>activate_job()</function> function:
533
532
<programlisting>
534
533
<function>schedule.activate_job(<parameter>job_id</parameter> <type>integer</type>)</function>
@@ -560,14 +559,14 @@ SELECT schedule.create_job('{"commands": "SELECT ''zzz''", &
560
559
</listitem>
561
560
<listitem>
562
561
<para>
563
- <function>get_owned_cron()</function> — retrieves job list
562
+ <function>get_owned_cron()</function> — retrieves the list of jobs
564
563
owned by user.
565
564
</para>
566
565
</listitem>
567
566
<listitem>
568
567
<para>
569
- <function>get_cron()</function> — retrieves job list executed
570
- as user.
568
+ <function>get_cron()</function> — retrieves the list of jobs executed
569
+ by user.
571
570
</para>
572
571
</listitem>
573
572
<listitem>
@@ -611,7 +610,7 @@ SELECT schedule.create_job('{"commands": "SELECT ''zzz''", &
611
610
</term>
612
611
<listitem>
613
612
<para>
614
- Specifies whether the scheduler is enabled on our system.</para>
613
+ Specifies whether the scheduler is enabled on your system.</para>
615
614
<para>Default: <literal>false</literal>.
616
615
</para>
617
616
</listitem>
@@ -702,7 +701,7 @@ SELECT schedule.create_job('{"commands": "SELECT ''zzz''", &
702
701
<listitem>
703
702
<para><literal>undefined</literal> — transaction has
704
703
not started yet. The last two values should not appear
705
- inside the user procedure. If you see them, they may
704
+ inside the user procedure. If you see them, it may
706
705
indicate an internal <filename>pgpro_scheduler</filename>
707
706
error.</para></listitem></itemizedlist>
708
707
</para>
@@ -958,7 +957,7 @@ schedule.create_job(<parameter>dates</parameter> <type>timestamp with time zone[
958
957
<literal>commands</literal>
959
958
</entry>
960
959
<entry>
961
- <type>text</type>, <type>text []</type>
960
+ <type>text</type>, <type>text[]</type>
962
961
</entry>
963
962
<entry>
964
963
<acronym>SQL</acronym> statements to execute. You can pass one or more <acronym>SQL</acronym>
@@ -1074,7 +1073,7 @@ schedule.create_job(<parameter>dates</parameter> <type>timestamp with time zone[
1074
1073
<type>interval</type>
1075
1074
</entry>
1076
1075
<entry>
1077
- Optional.The maximal time interval during which the
1076
+ Optional. The maximal time interval during which the
1078
1077
scheduled job can be executed. If this key is NULL or
1079
1078
not set, there are no time limits. Default: NULL.
1080
1079
</entry>
0 commit comments