Re: Timezone database changes

From: Magne Mæhre <Magne(dot)Mahre(at)Sun(dot)COM>
To: Trevor Talbot <quension(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Aidan Van Dyk <aidan(at)highrise(dot)ca>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Timezone database changes
Date: 2007-10-10 17:23:28
Message-ID: 470D0A90.9000401@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Trevor Talbot wrote:
>, what I meant at least (not sure if others meant it), is
> storing the value in the timezone it was entered, along with what zone
> that was. That makes the value stable with respect to the zone it
> belongs to, instead of being stable with respect to UTC. When DST
> rules change, the value is in effect "reinterpreted" as if it were
> input using the new rules. To me that's also what the name of the
> type suggests it does.

I would argue that this isn't necessarily more helpful than what we have.
Many of us work in an in an international environment, and DST rules (and,
I'm sure you all remember the Venezuela case, time zones) change, and
at different instances in time.

To reiterate what the SQL standard says, a WITH TIMEZONE element should
have information on the original time zone it was stored as, but only in
the form of an offset from UTC in hours and minutes. SQL has no
notion of time zone labels, so if we decide to store these, we wouldn't
be any closer to SQL compliancy. An interesting observation is that,
as far as I can tell, the original time zone is only applied when casting
the element to a string. Apart from that, it's not used.

I would suggest that the WITH TIMEZONE elements are converted to UTC when
inserted into the database. Since all operations on it are based on
its UTC form, it's most efficient ( I believe) if the data is stored that
way. To be compliant, an offset (hours and minutes) to the time zone
that was used when storing the time should be stored as well.

--Magne

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2007-10-10 17:28:29 Re: pg_standby location (was added the Skytools extended transaction ID module)
Previous Message Andy Colson 2007-10-10 17:17:11 full text search in 8.3