"trigger"ing a procedure every X minutes 
Author Message
 "trigger"ing a procedure every X minutes

Is the preferred method of calling a procedure every X minutes to have a
cronjob installed external to the database, or is there something I can
do internally to achieve the same effect (and would be portable along
with the database when/if I move it to a different machine)?

Thanks,
Fran

---------------------------(end of broadcast)---------------------------



Mon, 24 Nov 2003 01:24:53 GMT
 "trigger"ing a procedure every X minutes

Quote:

> Is the preferred method of calling a procedure every X minutes to have a
> cronjob installed external to the database, or is there something I can
> do internally to achieve the same effect (and would be portable along
> with the database when/if I move it to a different machine)?

I'm pretty sure there is no internal mechanism for scheduled
procedures.  I think the cronjob is your best bet.

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it {*filter*}d up my mind,
Now people just get uglier, and I got no sense of time...          --Dylan

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly



Mon, 24 Nov 2003 01:28:43 GMT
 "trigger"ing a procedure every X minutes

Quote:

> Is the preferred method of calling a procedure every X minutes to have a
> cronjob installed external to the database,

Yes.

I see no need for us to replicate the functionality of cron ...

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Mon, 24 Nov 2003 02:15:52 GMT
 "trigger"ing a procedure every X minutes

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.

Thanks for the info,
Fran

Quote:

> > Is the preferred method of calling a procedure every X minutes to have a
> > cronjob installed external to the database,

> Yes.

> I see no need for us to replicate the functionality of cron ...

>                         regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command



Mon, 24 Nov 2003 02:39:49 GMT
 "trigger"ing a procedure every X minutes

Quote:

> 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

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ThinX networked business services       Adlergasse 5, 4500 Solothurn
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command



Mon, 24 Nov 2003 03:40:43 GMT
 "trigger"ing a procedure every X minutes

Quote:
>> 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.

You might also be able to use pl/tcl's after function to do the same thing.

len morgan

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command



Mon, 24 Nov 2003 07:23:23 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. eVB app exits when "push"ing data with RDA

2. max of ("...","...","..")

3. "Ditto"ing new records in a multi table form

4. Problem with "Join"-ing in a select statement

5. a "refresh"ing mystery to me

6. "recover database" pauses for minutes

7. Announcing "Enjoy Every Report"

8. The "Every" clause in SB

9. Running a procedure every 10 minutes

10. "."and ","

11. aReport."Field".SetFilter("this")?

12. The+instruction+at+"0x1f90db9b"+referenced+memory+at+"0x7fa03794"+The+memory+cou


 
Powered by phpBB® Forum Software