Re: Temporal Units - Mailing list pgsql-general

From Rich Shepard
Subject Re: Temporal Units
Date
Msg-id Pine.LNX.4.64.0704281937000.17123@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: Temporal Units  ("Alexander Staubo" <alex@purefiction.net>)
Responses Re: Temporal Units  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Sun, 29 Apr 2007, Alexander Staubo wrote:

> This is a common enough problem. Three factors come to mind:
>
> (1) Can all your intervals be expressed in absolute time units, such as
> number of days? "Work shift" is a human concept whose length is defined by
> context.

Alexander,

   If the requirements were in days, weeks, and months I could probably find
a time unit that worked -- including the PostgreSQL-specific solution.
However, when a regulatory agencies requires sampling once per shift, there
may be 1, 2, or 3 shifts per day. I don't want to hard code the current
solution because the company may add or subtract shifts depending on
business conditions.

   I have a second column for 'interval_unit', but while that works it
strikes me as less-than-elegant SQL. However, it might be the pragmatic
answer, despite making it very difficult to do temporal arithmetic to see if
required sampling was done and entered in the application.

Thanks,

Rich

--
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.        |          Accelerator(TM)
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

pgsql-general by date:

Previous
From: David Lee Lambert
Date:
Subject: Re: Indirect access to data, given table name as a string
Next
From: Rich Shepard
Date:
Subject: DRI in Docs?