Re: storing TZ along timestamps

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: storing TZ along timestamps
Date: 2011-05-27 23:29:55
Message-ID: BANLkTinL7CDj+GShTY0SXWHnWNyGjQ8WNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 27, 2011 at 4:13 PM, Steve Crawford
<scrawford(at)pinpointresearch(dot)com> wrote:
> I am very interested in the use-case for this (in part as I'm working on a
> PG related time talk). My experience thus far is that people who want this
> do not fully understand the nature of date-time calculations and variables
> in PG.

The use cases I recall having been mentioned in the past were accurate
data retention and calendaring applications.

Accurate data retention for things like drug trials need to guarantee
they retain precisely what the user entered, not an equivalent value.
If you run a report on a drug trial you need to see that the event was
recorded as occuring at 1:00pm EST not 6:00pm GMT even if you happen
to run the report in London.

And calendaring apps want to know what timezone is attached to an
event, not only the point in time at which it occurs. If your plane
flight departs at 12:00pm GMT and lands at 2:00pm EST you need to know
that to book your taxi at 2:30pm EST -- not 7:30pm GMT.

Both of these two cases can be handled differently. The former by
storing the raw text inputs and then storing the interpreted value as
a derived column separetly, and the latter by storing the local time
zone to use for display as an additional attribute along with the
local address and other attributes of the calendar event.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Crawford 2011-05-27 23:57:56 Re: storing TZ along timestamps
Previous Message Steve Crawford 2011-05-27 23:13:12 Re: storing TZ along timestamps