Re: elegant and effective way for running jobs inside a database - Mailing list pgsql-hackers

From David Johnston
Subject Re: elegant and effective way for running jobs inside a database
Date
Msg-id 01d201ccfb25$af55a890$0e00f9b0$@yahoo.com
Whole thread Raw
In response to Re: elegant and effective way for running jobs inside a database  (Artur Litwinowicz <admin@ybka.com>)
List pgsql-hackers
> >
> > Keep in mind that it's not about coding in C but mostly about figuring
> > out what a sane design out to look like.
> >
>

While I can straddle the fence pretty my first reaction is that we are talking about "application" functionality that
fallsoutside what belongs in "core" PostgreSQL.  I'd rather see pgAgent be improved and act as a basic implementation
while,for more complex use-cases, letting the community/marketplace provide solutions. 

Even with simple use-cases you end up having a separate process continually running anyway.  The main benefit to
linkingwith core would be the ability to startup that process after the server starts and shutdown the process before
theserver shutdown.  That communication channel is something to consider outside this specific application and, if
done,could be used to talk with whatever designated "pgAgent"-like application the user chooses.  Other applications
couldalso be communicated with in this way.  Basically some form of API where in the postgres.conf file you specify
whichIP addresses and ports you wish to synchronize and which executable to launch just prior to communicating on said
port. If the startup routine succeeds that Postgres will, within reason, attempt to communicate and wait for these
externalprocess to finish before shutting down.  If the external application closes it should proactively notify
Postgresthat it is doing so AND if you startup a program manually it can look for and talk with a running Postgres
instance.

David J.





pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: WIP: URI connection string support for libpq
Next
From: Josh Berkus
Date:
Subject: Re: Checksums, state of play