Обсуждение: auto execute

Поиск
Список
Период
Сортировка

auto execute

От
Ric Mañalac
Дата:
hello,

how can i make postgres to execute a query automatically during
scheduled times?

here's my situation. i store records on a table. these records should be
removed 1 day after they were created.

thanks.

ric


Re: auto execute

От
Justin Clift
Дата:
Hi Ric,

You could use a cron job that executes a SQL statement to delete the old
records.

:-)

Regards and best wishes,

Justin Clift


Ric Mañalac wrote:
>
> hello,
>
> how can i make postgres to execute a query automatically during
> scheduled times?
>
> here's my situation. i store records on a table. these records should be
> removed 1 day after they were created.
>
> thanks.
>
> ric
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi

Re: auto execute

От
Keary Suska
Дата:
on 10/10/02 9:19 PM, ric.manalac@webphilippines.com purportedly said:

> how can i make postgres to execute a query automatically during
> scheduled times?
>
> here's my situation. i store records on a table. these records should be
> removed 1 day after they were created.

AFAIK, not solely within postgres. There needs to be some trigger point,
which could be a cron-invoked function, a trigger based on some action on
the table, or "cleanup" function that is called every time your app runs.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"


Re: auto execute

От
Bruno Wolff III
Дата:
On Fri, Oct 11, 2002 at 11:19:10 +0800,
  Ric Mañalac <ric.manalac@webphilippines.com> wrote:
> hello,
>
> how can i make postgres to execute a query automatically during
> scheduled times?
>
> here's my situation. i store records on a table. these records should be
> removed 1 day after they were created.

If they new to not be visible exactly 1 day after they are created, you
can use a view to do that. You will still want to run a cron job to
actually delete the records.