Using calendar syntax to specify a repeating interval v17
The CREATE_JOB
and CREATE_SCHEDULE
procedures use Oracle-style calendar syntax to define the interval with which a job or schedule is repeated. Provide the scheduling information in the repeat_interval
parameter of each procedure.
repeat_interval
is a value or series of values that define the interval between the executions of the scheduled job. Each value is composed of a token, an equals sign, and the units on which the schedule executes. Separate multiple token values with a semi-colon (;).
For example, the following value defines a schedule that's executed each weeknight at 5:45:
FREQ=DAILY;BYDAY=MON,TUE,WED,THU,FRI;BYHOUR=17;BYMINUTE=45
EDB Postgres Advanced Server supports the token types and syntax described in the table.
Token type | Syntax | Valid values |
---|---|---|
FREQ | FREQ=predefined_interval | Where predefined_interval is one of the following: YEARLY , MONTHLY , WEEKLY , DAILY , HOURLY , MINUTELY . The SECONDLY keyword isn't supported. |
BYMONTH | BYMONTH=month(, month)... | Where month is the three-letter abbreviation of the month name: JAN , FEB , MAR , APR , MAY , JUN , JUL , AUG , SEP , OCT , NOV , DEC |
BYMONTH | BYMONTH=month (, month)... | Where month is the numeric value representing the month: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
BYMONTHDAY | BYMONTHDAY=day_of_month | Where day_of_month is a value from 1 through 31 |
BYDAY | BYDAY=weekday | Where weekday is a three-letter abbreviation or single-digit value representing the day of the week. |
Monday | MON | 1 | | ||
Tuesday | TUE | 2 | | ||
Wednesday | WED | 3 | | ||
Thursday | THU | 4 | | ||
Friday | FRI | 5 | | ||
Saturday | SAT | 6 | | ||
Sunday | SUN | 7 | | ||
BYDATE | BYDATE=date(, date)... | Where date is YYYYMMDD .YYYY is a four-digit year representation of the year,MM is a two-digit representation of the month,and DD is a two-digit day representation of the day. |
BYDATE | BYDATE=date(, date)... | Where date is MMDD .MM is a two-digit representation of the month,and DD is a two-digit day representation of the day |
BYHOUR | BYHOUR=hour | Where hour is a value from 0 through 23 . |
BYMINUTE | BYMINUTE=minute | Where minute is a value from 0 through 59 . |