Re: Timed Triggers?

From: Rod Taylor <rbt(at)zort(dot)on(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Timed Triggers?
Date: 2000-10-09 23:02:16
Message-ID: 39E24E78.7A60A06C@zort.on.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> Rod Taylor <rod(dot)taylor(at)inquent(dot)com> writes:
> > With the number of cron jobs that run a perl script which runs a simple
> > SELECT function(); that does various nightly cleanup or maintenance
> > (billing run) it would be much nicer to have an actual trigger run every
> > 12 hours rather than be initiated by a cron job.
>
> Er ... why? Seems like what you're describing is implementing the guts
> of cron in the postmaster. I don't see a real good reason to re-invent
> the wheel like that.

My current concern is the reliance on cron, perl, and the postmaster
running properly in order to accomplish a job. When one fails, they
operation fails. If the postmaster is down, how does cron know that
something needs to be re-run? In the postmaster we could issue a
trigger of type 'once every 4 hours, and on startup' to ensure that the
billing run (or whatever) is executed properly as early as possibly. At
the moment it takes quite a bit of code outside of the database to
accomplish what would be a trivial setting for the creator of the
trigger to tie to it.

Your right though, it's too bad cron wasn't more library oriented so
that it could be used within programs rather than having to be
re-implemented.

--
Rod Taylor

"People get annoyed when you try to debug them." -- Larry Wall, 2nd
State of the Onion.

"A + B + C = Success if, A = Hard Work, B = Hard Play, C = Keeping your
mouth shut." -- Albert Einstein

--

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2000-10-09 23:11:04 RE: foreign key introduces unnecessary locking ?
Previous Message The Hermit Hacker 2000-10-09 22:55:39 Re: ALTER TABLE DROP COLUMN