To all who replied, first, thank you! Second, I simply said 'dirty'
never said dislike or anything like that. I've used and use cron for
different OS related operations and have for years. I LOVE cron itself.
What I mean with 'dirty' is that I'm trying to take away as much as
possible from external influences to the database action I want to happen.
Fine so let's say when the instructor creates the user profile, this can
trigger the creation of a sequence, say, but IF the instructor doesn't
visit that student's profile for a month, I want something that,
independent of any other action, will be either incrementing or
decrementing that sequence. So when the instructor does go back to
visit the student profile it will only show/flag the status if the time
has elapsed. Is there like a sleep() function that postgresql has?
That could be part of the plan. So sleep(24hours) - pseudo code - wake
up and increment something initiate trigger to see if a requirement has
been met - say 10day or 30day or 1year has elapsed - if so, set a flag
attribute to the student profile.
During that 30 days, the instructor won't care what's going on behind
the scenes, they just care when the time has elapsed, that they will get
a flag, to say, "hey buddy, over here, this student hasn't fulfilled the
agreement."
Based on what everyone is saying, there is no such internal mechanism
function/trigger or otherwise, that can do independent actions.
Andreas Kretschmer wrote:
louis gonzales <gonzales@xxxxxxxxxxxxxx> schrieb:
Hey Brian,
Yeah I had considered this, using cron, I just feel like that is too dirty.
Why?
Actually I didn't see Andreas' post, can someone forward that?
Sorry, i posted to the list, and i can see my mail.
I'm running this application on Solaris 9. Ultimately what I want to know
is, is there something that is internal to postgresql that can be used that
doesn't need external action, to make it do some task?
Take a look at http://pgfoundry.org/projects/pgjob/
Am I making any sense with how I'm asking this? I could of course have
cron do a scheduled task of checking/incrementing/decrementing and define
triggers to occur when one of the cron delivered actions sets the
appropriate trigger off, but are there other methods that are standard in
the industry or are we stuck with this type of external influence?
I'm using PG on Linux-systems and use CRON for any tasks, without any
problems. I can't understand your dislike...
Andreas
--
Email: louis.gonzales@xxxxxxxxxxxxxx
WebSite: http://www.linuxlouis.net
"Open the pod bay doors HAL!" -2001: A Space Odyssey
"Good morning starshine, the Earth says hello." -Willy Wonka