Re: storing TZ along timestamps - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: storing TZ along timestamps
Date
Msg-id 4E24B59B.5020909@agliodbs.com
Whole thread Raw
In response to Re: storing TZ along timestamps  (Jim Nasby <jim@nasby.net>)
Responses Re: storing TZ along timestamps
Re: storing TZ along timestamps
List pgsql-hackers
Jim,

> Right; you need a timestamp and you need to know what timezone that timestamp was entered in. That means you can
alwaysconvert that time to whatever timezone you'd like (like timestamptz), but you also know what time was originally
entered,and what timezone it was entered in. Technically you can do that with a separate field, but that seems really
uglyto me.
 

I disagree.  It's a good mapping of the actual data.

The timestamp and the timezone in which that timestamp was entered are
two separate pieces of data and *ought* to be in two separate fields.
For one thing, the question of "what timezone was this entered in" is an
application-specific question, since you have three different potential
timezones:

* the actual client timezone
* the actual server timezone
* the application timezone if the application has configurable timezones

In a builtin data type, which of those three would you pick?  Only the
application knows.

Additionally, if you have your timestamp-with-original-timezone data
type, then you're going to need to recode every single
timestamp-handling function and operator to handle the new type.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: storing TZ along timestamps
Next
From: Florian Pflug
Date:
Subject: Re: Commitfest Status: Sudden Death Overtime