Re: 'Universal' schedule table defintion

From: Richard Huxton <dev(at)archonet(dot)com>
To: gearond(at)cvc(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: 'Universal' schedule table defintion
Date: 2003-02-14 09:52:03
Message-ID: 200302140952.04009.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 13 Feb 2003 11:08 pm, Dennis Gearon wrote:
> Anyone ever seen a table definition for schedules that could handle the
> following:
>
> 'Every 3rd Thurday, except for national holidays'
> 'from 8 AM to 10PM, closed 12-1pm and 6-7pm'
> 'The period of time Thursday the Xth, xxxx to Sunday the Yth, xxxx,
> 11am to 8pm Thursday and Friday, 8am to 6pm Saturday and Sunday'
> 'Monday thru Friday 10-3pm' (my kind of hours!)
>
> Obviously, I can do this with the strings above, but there is now way that
> the database could search for occurences of those using the strings, unless
> I come up with a special 'schedule language' and write a function to use in
> the select statement, (which I may have to do anyway).

Two suggestions:

1. Explore "man crontab" for possibilities. If nothing else you'll be able to
explain it in the technical docs by saying "it's like crontab"

2. Even with (1) you're looking at sets of rows to represent some of the
above, I'd have a column with values of ADD|SUBTRACT to overlay rows and
produce the final pattern.

Best of luck, and I'd be interested in how well your choice works out for you.
--
Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-02-14 09:54:45 Re: uppercase = lowercase
Previous Message Lincoln Yeoh 2003-02-14 09:50:17 Re: 'Universal' schedule table defintion