Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 59d8451

Browse files
author
Vladimir Ershov
committed
english finished && typos
1 parent e7162eb commit 59d8451

File tree

2 files changed

+70
-72
lines changed

2 files changed

+70
-72
lines changed

README.md

Lines changed: 57 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@ pgpro_scheduler allows to schedule jobs execution and control their activity
44
in PostgreSQL database.
55

66
The job is the set of SQL commands. Schedule table could be described as a
7-
crontab-like
8-
string or as an JSON object. It's possible to use combination of both methods
9-
for scheduling settings.
7+
crontab-like string or as a JSON object. It's possible to use combination
8+
of both methods for scheduling settings.
109

1110
Each job could calculate its next start time. The set of SQL commands
1211
could be executed in the same transaction or each command could be executed in
13-
individual transaction. It's possible to set SQL command to be executed on
12+
individual one. It's possible to set SQL statement to be executed on
1413
failure of main job transaction.
1514

1615
## Installation
1716

18-
pgpro_scheduler is a regular PostgreSQL extension and require no prerequisites.
17+
pgpro_scheduler is a regular PostgreSQL extension and requires no prerequisites.
1918

20-
Before build extension from source make sure that the evironment variable
21-
PATH includes path to `pg_config` utility. Also make sure that you have
19+
Before build extension from the source make sure that the environment variable
20+
`PATH` includes path to `pg_config` utility. Also make sure that you have
2221
developer version of PostgreSQL installed or PostgrteSQL was built from
2322
source code.
2423

@@ -27,7 +26,7 @@ Install extension as follows:
2726
$ cd pgpro_scheduler
2827
$ make USE_PGXS=1
2928
$ sudo make USE_PGXS=1 install
30-
$ psql <DBNAME> -c "CREATE EXTNESION pgpro_scheduler"
29+
$ psql <DBNAME> -c "CREATE EXTENSION pgpro_scheduler"
3130

3231
## Configuration
3332

@@ -42,21 +41,21 @@ help to handle scheduler configuration.
4241
* **schedule.scheme** - text, the `scheme` name where scheduler store its
4342
tables and functions. To change this value restart required. Normally
4443
you should not change this variable but it could be useful if you
45-
want run scheduled jobs on hot-stanbdy database. So you can define
44+
want run scheduled jobs on hot-standby database. So you can define
4645
foreign data wrapper on master system to wrap default scheduler schema
4746
to another and use it on replica. Default value: schedule.
4847
* **schedule.nodename** - text, node name of this instance.
4948
Default value is `master`. You should not change or use it if you run
50-
single server configuration. But it is neccessary to change this name
49+
single server configuration. But it is necessary to change this name
5150
if you run scheduler on hot-standby database.
5251
* **schedule.max_workers** - integer, max number of simultaneously running
5352
jobs for one database. Default value: 2.
5453
* **schedule.transaction_state** - text, this is internal variable.
5554
This variable contains state of executed job. This variable was designed
56-
to use with a next job start time calculationi procedure.
55+
to use with a next job start time calculation procedure.
5756
Possible values are:
58-
* **success** - transaction finished successfully
59-
* **failure** - transaction failed to finish
57+
* **success** - transaction has finished successfully
58+
* **failure** - transaction has failed to finish
6059
* **running** - transaction is in progress
6160
* **undefined** - transaction has not started yet
6261

@@ -68,7 +67,7 @@ help to handle scheduler configuration.
6867
You could manage scheduler work by means of PostgreSQL variables described
6968
above.
7069

71-
For example, you have a fresh PostgreSQL installation with sheduler extension
70+
For example, you have a fresh PostgreSQL installation with scheduler extension
7271
installed. You are going to use scheduler with databases called 'database1' and
7372
'database2'. You want 'database1' be capable to run 5 jobs in parallel and
7473
'database2' - 3.
@@ -107,7 +106,7 @@ where:
107106

108107
* **N<sub>min</sub>** - the minimal acceptable amount of bgworkers in the
109108
system. Consider the fact that other systems need to start background
110-
workers too. E.g. parallel queries. So you need to ajust the value to
109+
workers too. E.g. parallel queries. So you need to adjust the value to
111110
their needs either.
112111
* **N<sub>databases</sub>** - the number of databases scheduler works with
113112
* **MAX_WORKERS<sub>n</sub>** - the value of `schedule.max_workers`
@@ -217,7 +216,7 @@ Creates job and sets it active.
217216

218217
Arguments:
219218

220-
* **date** - exect date of execution
219+
* **date** - exact date of execution
221220
* **sql** - SQL statement to execute
222221
* **node** - node name, optional
223222

@@ -229,7 +228,7 @@ Creates job and sets it active.
229228

230229
Arguments:
231230

232-
* **date** - exect date of execution
231+
* **date** - exec date of execution
233232
* **sqls** - set of SQL statements to be executed
234233
* **node** - node name, optional
235234

@@ -265,7 +264,7 @@ Creates job and sets it active.
265264

266265
The only argument is a JSONB object with information about job.
267266

268-
The object coubl contains the following keys, some of them could be omitted:
267+
The object could contains the following keys, some of them could be omitted:
269268

270269
* **name** - job name;
271270
* **node** - node name;
@@ -275,25 +274,25 @@ The object coubl contains the following keys, some of them could be omitted:
275274
* **command** - SQL statement to be executed;
276275
* **commands** - a set of SQL statements to be executed as an array;
277276
* **run\_as** - user to execute command(s);
278-
* **start\_date** - begin of period while command could be executed,
277+
* **start\_date** - begin of period while command can be executed,
279278
could be NULL;
280-
* **end\_date** - end of period while command could be executed,
279+
* **end\_date** - end of period while command can be executed,
281280
could be NULL;
282281
* **date** - exact date when command will be executed;
283282
* **dates** - set of exact dates when command will be executed;
284283
* **use\_same\_transaction** - if set of commands will be executed within
285284
the same transaction. Default: false;
286-
* **last\_start\_available** - for how long could command execution could be
285+
* **last\_start\_available** - for how long command execution could be
287286
postponed if maximum number of allowed workers reached at the scheduled
288287
moment. Time set in format of `interval`. E.g. '00:02:34' - it is
289-
possible to wait for 2 minutes 34 seconds. If time is NULL or not set will
290-
wait forever. Default: NULL;
291-
* **max\_run\_time** - for how long scheduled job could be executed.
288+
possible to wait for 2 minutes 34 seconds. If time is NULL or not set
289+
waits forever. Default: NULL;
290+
* **max\_run\_time** - for how long scheduled job can be executed.
292291
Format: `interval`. If NULL or not set - there is no time limits.
293292
Default: NULL;
294293
* **onrollback** - SQL statement to be executed on ROLLBACK if main
295294
transaction failure. Default: not defined;
296-
* **next\_time\_statement** - SQL statement to caclulate next start time.
295+
* **next\_time\_statement** - SQL statement to calculate next start time.
297296

298297
The rules of scheduling could be set as cron-like string (key `cron`) and
299298
also as JSONB object (key `rule`).
@@ -311,21 +310,21 @@ This object contains the following keys:
311310
Also job could be scheduled on exact date or set of dates. Use keys `date`
312311
and `dates` keys accordingly.
313312

314-
All scheduling mwthods could be combined but the use at least one of them is
313+
All scheduling methods could be combined but the use of at least one of them is
315314
mandatory.
316315

317-
Key `next_time_statement` should contains SQL statment to be executed
318-
after the main transaction to calculate net start time. If key is defined
316+
Key `next_time_statement` may contain SQL statement to be executed
317+
after the main transaction to calculate next start time. If key is defined
319318
the first start time will be calculated by methods described above but
320319
successive start times will be derived from this statement. The statement
321320
must return record with the first field containing value of type
322321
`timestamp with time zone`. If returning value be of the different type or
323-
statement exection produce an error the job will be marked as broken and further
322+
statement execution produce an error the job will be marked as broken and further
324323
execution will be prohibited.
325324

326-
This statment will be executed in spite of main transaction execution state.
325+
This statement will be executed in spite of main transaction execution state.
327326
It's possible to get state of main transaction form postgres variable
328-
schedule.transaction_state`.
327+
`schedule.transaction_state`.
329328

330329
The possible values are:
331330

@@ -338,11 +337,11 @@ The last two values should not appear as a value of the key
338337
`next_time_statement` within user procedure.
339338

340339
SQL statement to be executed could be set in `command` or `commands` key.
341-
The first one set the single statement, the second the set of statements.
340+
The first one sets the single statement, the second - the set of statements.
342341
In fact the first key could contains the set of commands in one string
343342
divided by semicolon. In this case they all be executed in single transaction
344343
in spite of the value `use_same_transaction`. So for set of the statements
345-
is better to use key `commands` key as you get more controll on execution.
344+
is better to use key `commands` key as you get more control on execution.
346345

347346
Returns id of created job.
348347

@@ -375,7 +374,7 @@ Arguments:
375374
* **value** - property value
376375

377376
The full list of the properties could be found in `schedule.create_job`
378-
function description. Some values are of array types. This **value** could
377+
function description. Some values are of array types. Their **value** could
379378
be passed as an array, but if the value could not be an array the exception
380379
will be raised.
381380

@@ -416,7 +415,7 @@ Returns true on success, false on failure.
416415

417416
### schedule.get_job(job_id integer)
418417

419-
Retrieves information about the job
418+
Retrieves information about the job.
420419

421420
Arguments:
422421

@@ -434,12 +433,12 @@ Arguments:
434433
* **username** - user name, optional
435434

436435
Returns the set of records of type `cron_rec`. Records contain information
437-
about jobs owned by user. If user name is not specified session user is
436+
about jobs owned by user. If user name is omitted the session user name is
438437
used.
439438

440-
Retrive jobs owned by another user is allowed only to superuser.
439+
Retrieve jobs owned by another user is allowed only to superuser.
441440

442-
Type `cron_rec` description can be found in **SQL type** section.
441+
`cron_rec` type description can be found in **SQL type** section.
443442

444443
### schedule.get_user_cron(username text)
445444

@@ -453,7 +452,7 @@ Returns the set of records of type `cron_rec`. Records contain information
453452
about jobs executed as user. If user name is not specified session user is
454453
used.
455454

456-
Retrive jobs executed as another user is allowed only to superuser.
455+
Retrieve jobs executed as another user is allowed only to superuser.
457456

458457
Type `cron_rec` description can be found in **SQL type** section.
459458

@@ -465,47 +464,46 @@ Arguments:
465464

466465
* **username** - user name, optional
467466

468-
If user name not specified the session user name used. To list jobs executed
467+
If user name is omitted the session user name used. To list jobs executed
469468
as another user allowed only to superuser.
470469

471470
Return value is set of records of type `cron_job`.
472-
See type description in **SQL types** section.
471+
See the type description in **SQL types** section.
473472

474473
### schedule.get_active_jobs()
475474

476-
Функция возвращает список всех задач, которые исполняются в данный момент.
477-
Может быть выполнена только пользователем с правами суперпользователя.
475+
Returns list of jobs being executed at that very moment.
476+
The function call allowed only to superuser.
478477

479-
Задачи возвращаются в виде набора записей типа `cron_job`. Описание типа вы
480-
можете найти в разделе **SQL типы**.
478+
Return value is set of records of type `cron_job`.
479+
See the type description in **SQL types** section.
481480

482481
### schedule.get_log()
483482

484-
Функция возвращает список всех выполненых задач.
485-
Может быть выполнена только пользователем с правами суперпользователя.
483+
Returns list of all completed jobs.
484+
The function call allowed only to superuser.
486485

487-
Задачи возвращаются в виде набора записей типа `cron_job`. Описание типа вы
488-
можете найти в разделе **SQL типы**.
486+
Return value is set of records of type `cron_job`.
487+
See the type description in **SQL types** section.
489488

490489
### schedule.get_user_log(username text)
491490

492-
Функция возвращает список всех выполненых задач, которые выполнялись с правами
493-
пользователя, переданного в аргументах.
491+
Returns list of completed jobs executed as user passed in arguments.
494492

495493
Arguments:
496494

497-
* **username** - имя пользователя, опционально
495+
* **username** - user name, optional
498496

499-
Если не указано имя пользователя, то используется имя пользователя сессии.
500-
Чужие задачи может просматривать только суперпользователь.
497+
If username is omitted the session user name used.
498+
Jobs executed as another users are accessible only to superuser.
501499

502-
Задачи возвращаются в виде набора записей типа `cron_job`. Описание типа вы
503-
можете найти в разделе **SQL типы**.
500+
Return value is set of records of type `cron_job`.
501+
See the type description in **SQL types** section.
504502

505503
### schedule.clean_log()
506504

507-
Удаляет все записи о выполненных задачах. Может быть выполнена только с правами
508-
суперпользователя.
505+
Delete all records with information about completed jobs.
506+
Can be called by superuser only.
509507

510-
Возвращает количество удаленных записей
508+
Returns the number of records deleted.
511509

0 commit comments

Comments
 (0)