Re: [SQL] [ADMIN] Is there anyway to...

From: Richard Huxton <dev(at)archonet(dot)com>
To: operationsengineer1(at)yahoo(dot)com
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [SQL] [ADMIN] Is there anyway to...
Date: 2006-11-09 10:19:47
Message-ID: 455300C3.4050008@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-sql

operationsengineer1(at)yahoo(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Paolo Negri 2006-11-09 10:26:31 Re: pg_dump and foreign keys troubles
Previous Message Andy Shellam (Mailing Lists) 2006-11-09 09:53:57 Re: Checkpoint Location Format

Browse pgsql-general by date

  From Date Subject
Next Message Gregory S. Williamson 2006-11-09 10:35:31 Re: planer picks a bad plan (seq-scan instead of index)
Previous Message Richard Huxton 2006-11-09 10:16:06 Re: Can PostgreSQL notify a client that a trigger has fired?

Browse pgsql-sql by date

  From Date Subject
Next Message Stuart Brooks 2006-11-10 10:21:02 Constraint on multicolumn index
Previous Message operationsengineer1 2006-11-09 01:24:17 Re: [SQL] [ADMIN] Is there anyway to...