Thread: Scheduling/Automated Jobs in Postgre
Hi All,
I need to do some user defined jobs when ever the Postgre server gets restarted. These tasks should be automated one i.e) When ever I restart the server the PL/SQL functions I have defined should be executed automatically without my intervention. This is to record some information like Audit Trails and some more.
Could any one tell me how can I implement this in Postgre. Is there any concept like "Scheduled Jobs" in Postgre. If so pls. provide me with related informations or the links from where I could get them.
With Regards,
Aravindhan.
On Wed, Mar 02, 2005 at 10:09:53AM +0530, Aravindhan G.D wrote: > I need to do some user defined jobs when ever the Postgre server > gets restarted. These tasks should be automated one i.e) When ever > I restart the server the PL/SQL functions I have defined should be > executed automatically without my intervention. This is to record > some information like Audit Trails and some more. You could add an appropriate command to your PostgreSQL startup script. > Could any one tell me how can I implement this in Postgre. Is > there any concept like "Scheduled Jobs" in Postgre. If so pls. > provide me with related informations or the links from where I could > get them. PostgreSQL doesn't have a scheduler -- most operating systems have one (e.g., cron on Unix-like systems), so that's what people use. (BTW, it's "PostgreSQL" or "Postgres", not "Postgre".) -- Michael Fuhr http://www.fuhr.org/~mfuhr/
adamodharan@ivesia.com ("Aravindhan G.D") wrote: > I need to do some user defined jobs when ever the Postgre server > gets restarted. These tasks should be automated one i.e) When ever I > restart the server the PL/SQL functions I have defined should be > executed automatically without my intervention. This is to record > some information like Audit Trails and some more. You could add this into whatever script starts up pg_ctl, but only if you decide to use PostgreSQL rather than "Postgre". > Could any one tell me how can I implement this in Postgre. Is there > any concept like "Scheduled Jobs" in Postgre. If so pls. provide me > with related informations or the links from where I could get them. There surely is. Use cron(8). But that's only true with PostgreSQL, not with "Postgre". This mailing list addresses PostgreSQL, not Postgre. -- let name="cbbrowne" and tld="gmail.com" in String.concat "@" [name;tld];; http://linuxdatabases.info/info/slony.html Some people are only alive because it is illegal to kill.
This is something that comes up every few months. Core is of the opinion that you should just use the tools of your OS. Personally, I think some kind of job system in the database would be very useful, so the last time this came up I created http://pgfoundry.org/projects/pgjob/. No work is being done on it right now, but if this is something you have an interest in you should sign up for the mailing list. On Wed, Mar 02, 2005 at 10:09:53AM +0530, Aravindhan G.D wrote: > Hi All, > > I need to do some user defined jobs when ever the Postgre server gets restarted. These tasks should be automated one i.e)When ever I restart the server the PL/SQL functions I have defined should be executed automatically without my intervention.This is to record some information like Audit Trails and some more. > > Could any one tell me how can I implement this in Postgre. Is there any concept like "Scheduled Jobs" in Postgre. If sopls. provide me with related informations or the links from where I could get them. > > With Regards, > Aravindhan. -- Jim C. Nasby, Database Consultant decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"
You could add this into whatever script starts up pg_ctl, but only if you decide to use PostgreSQL rather than "Postgre". > Could any one tell me how can I implement this in Postgre. Is there > any concept like "Scheduled Jobs" in Postgre. If so pls. provide me > with related informations or the links from where I could get them. There surely is. Use cron(8). But that's only true with PostgreSQL, not with "Postgre". This mailing list addresses PostgreSQL, not Postgre. -- let name="cbbrowne" and tld="gmail.com" in String.concat "@" [name;tld];; http://linuxdatabases.info/info/slony.html Some people are only alive because it is illegal to kill.