Re: Comment on timezone and interval types - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Comment on timezone and interval types
Date
Msg-id 20041024115952.GA5188@svana.org
Whole thread Raw
In response to Comment on timezone and interval types  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Comment on timezone and interval types
List pgsql-general
On Sat, Oct 23, 2004 at 06:49:15PM -0500, Bruno Wolff III wrote:
> Recently there has been some discussion about attaching a timezone to
> a timestamp and some other discussion about including a 'day' part
> in the interval type. These two features impact each other, since
> if you add a 'day' to a timestamp the result can depend on what timezone
> the timestamp is supposed to be in. It probably makes more sense to use
> a timezone associated with the timestamp than say the timezone GUC or the
> fixed timezone UTC.

I agree. One issue I can think of is that if you store each timestamp
as a (seconds,timezone) pair, the storage requirements will balloon,
since timezone can be something like "Australia/Sydney" and this will
be repeated for every value in the table. I don't know how to deal
easily with this since there is no unique identifier to timezones and
no implicit order.

The only solution I can think of is have initdb create a pg_timezones
table which assigns an OID to each timezone it finds. Then the type can
use that.

I think this is a good solution actually, any thoughts?
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Sim Zacks
Date:
Subject: Re: sequence behavior - is this correct
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL Security Release(s) for 7.2, 7.3 and 7.4