Skip to content

Commit 3d32034

Browse files
author
Liudmila Mantrova
committed
Addressed A.Lakhin comments in pgpro-scheduler documentation
1 parent cd26164 commit 3d32034

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

doc/src/sgml/pgpro-scheduler.sgml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<itemizedlist>
3737
<listitem>
3838
<para>
39-
With <filename>pgpro_scheduler</filename> enabled, any user can
39+
Any user can
4040
schedule jobs independently.
4141
</para>
4242
</listitem>
@@ -56,7 +56,7 @@
5656
</listitem>
5757
<listitem>
5858
<para>
59-
Each database has its own "supervisor" scheduler, with each
59+
Each database has its own <quote>supervisor</quote> scheduler, with each
6060
scheduled job executed by a separate background worker for
6161
enhanced stability.
6262
</para>
@@ -74,9 +74,8 @@
7474
<filename>pgpro_scheduler</filename>:</para>
7575
<orderedlist>
7676
<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:
8079
<programlisting>
8180
shared_preload_libraries = 'pgpro_scheduler'
8281
</programlisting></para>
@@ -305,8 +304,8 @@ For details, see <xref linkend="schedule-create-job"> function description.</par
305304
<emphasis role="strong">Examples:</emphasis>
306305
</para>
307306
<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:
310309
</para>
311310
<programlisting>
312311
SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT 15&quot;, &quot;cron&quot;: &quot;0 15 * * *&quot;, &quot;dates&quot;: [ &quot;2017-12-31 19:00&quot;, &quot;2020-04-04 13:00&quot; ]}');
@@ -326,7 +325,7 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT pg_sleep(100)&qu
326325
ensure that <filename>pgpro_scheduler</filename> only executes
327326
the job within the specified time window, define the
328327
<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
330329
of these keys only to limit the start or the end time,
331330
respectively. If you define a time window for the job,
332331
<filename>pgpro_scheduler</filename> will only schedule this job
@@ -344,8 +343,8 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT now()&quot;, &qu
344343
</programlisting>
345344
</para>
346345
<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:
349348
<programlisting>
350349
SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT now()&quot;, &quot;cron&quot;: &quot;2 17 * * *&quot;, &quot;start_date&quot;: &quot;2017-05-01 11:00&quot;, &quot;end_date&quot;: &quot;2017-06-04 15:00&quot; }');
351350
</programlisting>
@@ -367,7 +366,7 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT now()&quot;, &qu
367366
<emphasis role="strong">Examples:</emphasis>
368367
</para>
369368
<para>
370-
To run the whole job in the same transaction:
369+
To run the whole job in a single transaction:
371370
</para>
372371
<programlisting>
373372
SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT 1; SELECT 2; SELECT 3;&quot;, &quot;cron&quot;: &quot;23 23 */2 * *&quot; }');
@@ -379,7 +378,7 @@ SELECT schedule.create_job('{&quot;commands&quot;: [ &quot;SELECT 1&quot;, &quot
379378
</programlisting>
380379
</para>
381380
<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
383382
commands as an array:
384383
<programlisting>
385384
SELECT schedule.create_job('{&quot;commands&quot;: [ &quot;SELECT 1&quot;, &quot;SELECT 2&quot;, &quot;SELECT 3&quot; ], &quot;cron&quot;: &quot;23 23 */2 * *&quot;, &quot;use_same_transaction&quot;: true }');
@@ -399,16 +398,16 @@ SELECT schedule.create_job('{&quot;commands&quot;: [ &quot;SELECT 1&quot;, &quot
399398
After the job run completes,
400399
<filename>pgpro_scheduler</filename> executes the <acronym>SQL</acronym> statement
401400
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
404403
type or an error occurs, <filename>pgpro_scheduler</filename>
405404
marks the job as broken and cancels any further execution.
406405
This process is repeated for each successive job run.</para>
407406
<tip><para>When the job run
408407
completes, <filename>pgpro_scheduler</filename> sets the
409408
transaction status in the
410409
<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
412411
<literal>next_time_statement</literal> to dynamically
413412
calculate the next start time depending on the transaction
414413
status. At the time of the
@@ -483,7 +482,7 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT session_user&quo
483482
</programlisting>
484483
</para>
485484
<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:
487486
<programlisting>
488487
SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT ''zzz''&quot;, &quot;cron&quot;: &quot;55 */12 * * *&quot;, &quot;on_rollback&quot;: &quot;SELECT ''An error occurred''&quot; }');
489488
</programlisting>
@@ -494,11 +493,11 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT ''zzz''&quot;, &
494493
<title>Changing and Removing Scheduled Jobs</title>
495494
<para>
496495
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
499498
job ID returned by the <function>create_job()</function> function,
500499
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
502501
the jobs, use <function>set_job_attribute()</function> or
503502
<function>set_job_attributes()</function> functions: </para>
504503
<itemizedlist>
@@ -528,7 +527,7 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT ''zzz''&quot;, &
528527
</programlisting>
529528
</para>
530529
<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
532531
<function>activate_job()</function> function:
533532
<programlisting>
534533
<function>schedule.activate_job(<parameter>job_id</parameter> <type>integer</type>)</function>
@@ -560,14 +559,14 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT ''zzz''&quot;, &
560559
</listitem>
561560
<listitem>
562561
<para>
563-
<function>get_owned_cron()</function> &mdash; retrieves job list
562+
<function>get_owned_cron()</function> &mdash; retrieves the list of jobs
564563
owned by user.
565564
</para>
566565
</listitem>
567566
<listitem>
568567
<para>
569-
<function>get_cron()</function> &mdash; retrieves job list executed
570-
as user.
568+
<function>get_cron()</function> &mdash; retrieves the list of jobs executed
569+
by user.
571570
</para>
572571
</listitem>
573572
<listitem>
@@ -611,7 +610,7 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT ''zzz''&quot;, &
611610
</term>
612611
<listitem>
613612
<para>
614-
Specifies whether the scheduler is enabled on our system.</para>
613+
Specifies whether the scheduler is enabled on your system.</para>
615614
<para>Default: <literal>false</literal>.
616615
</para>
617616
</listitem>
@@ -702,7 +701,7 @@ SELECT schedule.create_job('{&quot;commands&quot;: &quot;SELECT ''zzz''&quot;, &
702701
<listitem>
703702
<para><literal>undefined</literal> &mdash; transaction has
704703
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
706705
indicate an internal <filename>pgpro_scheduler</filename>
707706
error.</para></listitem></itemizedlist>
708707
</para>
@@ -958,7 +957,7 @@ schedule.create_job(<parameter>dates</parameter> <type>timestamp with time zone[
958957
<literal>commands</literal>
959958
</entry>
960959
<entry>
961-
<type>text</type>, <type>text []</type>
960+
<type>text</type>, <type>text[]</type>
962961
</entry>
963962
<entry>
964963
<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[
10741073
<type>interval</type>
10751074
</entry>
10761075
<entry>
1077-
Optional.The maximal time interval during which the
1076+
Optional. The maximal time interval during which the
10781077
scheduled job can be executed. If this key is NULL or
10791078
not set, there are no time limits. Default: NULL.
10801079
</entry>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy