From: Richard Huxton <dev@archonet.com>
To: operationsengineer1@yahoo.com
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: [SQL] [ADMIN] Is there anyway to...
Date: Thu, 09 Nov 2006 10:19:47 +0000
Message-ID: <455300C3.4050008@archonet.com> (raw)
In-Reply-To: <20061109012417.34765.qmail@web33310.mail.mud.yahoo.com>
References: <20061109012417.34765.qmail@web33310.mail.mud.yahoo.com>
operationsengineer1@yahoo.com wrote:
> i'm wanting to learn something here so i'm going to
> chime in.
>
> the way i read what you are saying is that you'd have
> start_date and number_days columns in your table.
>
> each day a query would run and pull the start_date and
> numbers_days columns.
>
> the application (or postgresql function) would then
> take the current date, subtract starte date and
> compare it to number of days. if it is above that
> number, the code will take some sort of action.
>
> is that about it or have i missed something?
I think that's what Jim's talking about. Databases are good at filtering
large numbers of rows.
You'll also want some sort of status code or "processed" flag, so you
know not to look at rows you've already handled.
The other alternative would be an "expiry_list" table that stores the
target row's key and when it expires. Add a row when the contract is
created. Delete the row when the contract is paid. Keep it all
up-to-date with triggers.
--
Richard Huxton
Archonet Ltd
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: dev@archonet.com, operationsengineer1@yahoo.com, pgsql-general@postgresql.org
Subject: Re: [SQL] [ADMIN] Is there anyway to...
In-Reply-To: <455300C3.4050008@archonet.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