Temporal Units

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Temporal Units
Date: 2007-04-28 21:44:32
Message-ID: Pine.LNX.4.64.0704281434570.6316@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would like to store a temporal frequency as NUMERIC, without units, and
have the application's front end (or middleware) transform the number to the
appropriate interval name. I'm having difficulties figuring out how to do
this.

For example, an event might occur once per work shift, day, week,
fortnight, or month. For comparison and checking purposes, it would be
easier to store a single frequency (e.g., days), but have the users enter
and display using other units (for example, a radiobox that presents the
units as days or other times).

Has this been done before? Or, do I need two columns (frequency and name)
and do the conversion to a common time unit behind the scenes?

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Staubo 2007-04-28 23:36:06 Re: Temporal Units
Previous Message Kris Jurka 2007-04-28 21:01:34 Re: "Protocol error. Session setup failed" (PostgreSQL 8.3devel/postgresql-8.3dev-600.jdbc3)