Re: Scheduler in Postgres

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: Scheduler in Postgres
Дата
Msg-id m3ekhp37sj.fsf@knuth.knuth.cbbrowne.com
обсуждение исходный текст
Ответ на Re: Sheduler in Postgres  (Ben <bench@silentmedia.com>)
Ответы Re: Scheduler in Postgres
Список pgsql-general
After a long battle with technology, gsstark@mit.edu (Greg Stark), an earthling, wrote:
> This wouldn't really be a part of Postgres though, just another
> application using Postgres. It could be something Postgres could
> recommend for people who find cron too awkward for their
> application.

This has considerable merit.

One thing that is unfortunate about cron is that it provides little
verifyable feedback.  It logs some things, sort of...

A "cron implementation using PostgreSQL as data store" would have a
wonderfully natural place to record log information in a usefully
structured fashion.

When a job runs, it would be a splendid idea to record such things as:
 - Job ID (perhaps an OID, or some other candidate primary key)
 - PID
 - Start time
 - End time
 - Exit code

Given all of the above, a job might look at the logs and
self-terminate if there's another instance still running from last
hour.

Jobs that are supposed to be mutually exclusive could detect as much.

You could _attempt_ to run a job every hour, and have it decide "Oh,
I've already run successfully in the last [interval], so I'll not
bother."

None of this means forcing it into the database implementation; it
just means that it would be useful.  "pgcron" sounds like an utterly
splendid idea.
--
output = ("cbbrowne" "@" "gmail.com")
http://www3.sympatico.ca/cbbrowne/x.html
"Applicants must  have *at least*  five years experience  with Windows
XCVIII..."

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Non-aggregate values attached to aggregates?
Следующее
От: Neil Conway
Дата:
Сообщение: Re: pl/pgsql oddity