Want to schedule tasks for the future

Поиск
Список
Период
Сортировка
От Matthew Wilson
Тема Want to schedule tasks for the future
Дата
Msg-id i120sk$u8n$1@dough.gmane.org
обсуждение исходный текст
Ответы Re: Want to schedule tasks for the future  (Sam Mason <sam@samason.me.uk>)
Re: Want to schedule tasks for the future  (Vick Khera <vivek@khera.org>)
Re: Want to schedule tasks for the future  (bs <Bernhard.1234@web.de>)
Список pgsql-general
Just recently I discovered the listen/notify feature in postgresql.
Now I don't have external processes polling tables, watching for new
inserted rows.

Anyhow, I'm curious if there is some other feature that will help me out
with a new puzzle.

I want to store emails to deliver at a later time in my database.  For
example, I want to remember that tomorrow morning at 9:00 am, I want to
send a particular email.

I'll use a table sort of like this

    create table scheduled_email (
        to_address text,
        email_subject text,
        email_body text,
        deliver_at timestamp,
        sent boolean
    );

I know I could write an external process to poll this table and select
all rows where deliver_at < current_timestamp and sent = 'f'.

But is there some other way inside postgresql that will do something
similar?  I would want something like listen/notify, where postgres
starts an external process when any data exist.

Thanks for the help.

Matt

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: make view with union return one record
Следующее
От: Andy Colson
Дата:
Сообщение: Re: make view with union return one record