Re: "trigger"ing a procedure every X minutes

From: <Herbert(dot)Liechti(at)thinx(dot)ch>
To: Fran Fabrizio <ffabrizio(at)Exchange(dot)WebMD(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: "trigger"ing a procedure every X minutes
Date: 2001-06-06 18:50:35
Message-ID: Pine.LNX.4.33.0106062045070.13671-100000@standbyme.thinx.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 6 Jun 2001, Fran Fabrizio wrote:

>
> Some thoughts are:
>
> 1. It would be portable with the database. I don't have to go setting up
> crons on the new machine if I move the db.
> 2. The cron usually involves writing a shell/perl/whatever script to call
> the psql client and pass in SQL queries via STDIN or file redirect just to
> invoke the desired procedure. An internal mechanism would bypass all of
> that.
> 3. All of the code that maintains the database could be in one place
> internal to the db.
>
> It's certainly not a big deal to use the cron, I just thought maybe someone
> had experimented with an internal mechanism. I'd like to try it someday,
> when I know a lot more about Pg. My current project has an ever-growing
> number of cron jobs (up to 6 now) and was just thinking about various ways to
> tidy it up.

If you like to avoid the aid of your OS maybe Perl is your friend. There
is a library Schedule::Cron which does the same as the crontab. I guess
portability is given if you have your scheduler on the application level.

See http://search.cpan.org?mode=module&query=cron

Best regards
Herbie

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti E-Mail: Herbert(dot)Liechti(at)thinx(dot)ch
ThinX networked business services Adlergasse 5, 4500 Solothurn
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2001-06-06 18:52:48 Re: PostgreSQL Replication Server?
Previous Message Stephan Szabo 2001-06-06 18:50:15 Re: [SQL] maximum number of rows in table - what about oid limits?