Re: Temporal Units - Mailing list pgsql-general

From Lew
Subject Re: Temporal Units
Date
Msg-id IJCdnRD0HqfQsaTbnZ2dnUVZ_j-dnZ2d@comcast.com
Whole thread Raw
In response to Re: Temporal Units  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Temporal Units
List pgsql-general
John D. Burger wrote:
>> There was a brief discussion of this just last week, with a few solutions
>> suggested:
>>
>> http://archives.postgresql.org/pgsql-general/2007-04/msg01098.php

Rich Shepard wrote:
>   That thread asked how to find business days between any two specified
> dates. I would like to create a calendar table that includes business days,
> holidays, Julianized dates, and other interesting tid-bits that are of
> value
> in a business application. Then dates can be looked up in the table to
> learn
> their attributes and the calculations don't need to be done each time.

The best solution I've encountered so far to this type of problem is to have a
table of "days" with columns like isWeekday, isHoliday, julianDay,
otherTidbit, ...

Then you select or join the days within the interval of interest and factor
out weekdays, or holidays, or whatever.

--
Lew

pgsql-general by date:

Previous
From: Barry Brown
Date:
Subject: Separating function privileges from tables
Next
From: jasme
Date:
Subject: WAL