Sheduling in SQL
| От | Paul |
|---|---|
| Тема | Sheduling in SQL |
| Дата | |
| Msg-id | 2618870624.20010315144047@mail.ru обсуждение исходный текст |
| Ответы |
Re: Sheduling in SQL
Re: Sheduling in SQL |
| Список | pgsql-hackers |
Sorry, if I used not corresponding mailing list, but I really dont know where to send such email. Is that possible to add one more SQL command to Postgres? The problem that IMHO no one RDBMS allows SQL command for sheduling. To support sheduling SQL programmers have to use outer tools to periodically check database if event commit. But IMHO it's much better to add one more SQL command to allow sheduling in same SQL. My thoughts about such command follow: ===================================================================== The SQL command for sheduler creating: CREATE SHEDULER name ON table.field [FOR [EACH]|[LAST]] EXECUTE PROCEDURE func(arguments) When the current time becomes equal or more than minimal time in the _table.field_, the event happens and the _func_ will be executed, and after that all records in this _table_ that in the _field_ have time equal or less than current time will be deleted. The other fields of this _table_ could be used as _arguments_ (or agregates of the other fields when _FOR EACH_ is absent). _FOR LAST_ - only for the record(s) of the _table_ that has(ve) the maximum time (that equal or less the current time) the event(s) will be processed. _FOR EACH_ - if there is such parameter for each corresponding record the event could be processed, not for all at once. For each _CREATE SHEDULER_ will be created: 1. B-tree index on _table.field_. 2. Inner trigger on insert/delete/update _table.field_ to have up to date min(_table.field_) for nearest event processing. The SQL command for sheduler deleting: DELETE SHEDULER name ==================================================================== -- Best regards,Paul Mamin mailto:magamos@mail.ru
В списке pgsql-hackers по дате отправления: