From: Glen Parker <glenebob@nwlink.com>
To: pgsql-general@postgresql.org
Subject: Re: Is there anyway to...
Date: Thu, 02 Nov 2006 19:14:55 -0800
Message-ID: <454AB42F.9080406@nwlink.com> (raw)
In-Reply-To: <c0a118d70611021836h61b71f66m3c6a58175126b9b6@mail.gmail.com>
References: <20061102171624.GE21312@localhost>
<454A357E.6010409@linuxlouis.net>
<454A394C.7020102@zijn-digital.com>
<454A3EB6.8080806@linuxlouis.net>
<454A40E3.40007@nwlink.com>
<26B58EAC-4BCC-470E-AC5E-477A5AA4CA52@themactionfaction.com>
<c0a118d70611021836h61b71f66m3c6a58175126b9b6@mail.gmail.com>
Wes Sheldahl wrote:
> if you did have a cron
> job run to check, you would probably just have it set a boolean field on
> expired records or something of that sort, and run it a little after
> midnight, at the start of each day, assuming durations were always being
> measured in days.
Exactly. You flag when you discover an expired condition, and you flag
again when the condition is acted upon. Easy. The instructor doesn't
need to be bothered any more than you choose. You could even set a
timestamp indicating the last time the instructor was harrassed about
it, so you can re-harrass on a daily or weekly basis :-)
Now, my example that had the expire query run when the instructor logs
on was just to illustrate that if you do this right, it doesn't matter
when the code runs. Personally, I'd have a cron job do it at midnight,
but whenever it runs, even if it's multiple times a day, the outcome
should still be correct. That's where your status flags come in. Once a
record has been expired, there's no reason for your expire code to ever
look at that record again, right?
-Glen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: glenebob@nwlink.com, pgsql-general@postgresql.org
Subject: Re: Is there anyway to...
In-Reply-To: <454AB42F.9080406@nwlink.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox