>>>>> "Kevin" == Kevin Grittner <kevin.gritt...@wicourts.gov> writes:

 >>> For example, if you have a type T which incorporates a timestamp
 >>> and a timezone, what semantics does the T = T operator have?  What
 >>> semantics apply if the definitions of timezones change?
 
 Kevin> I'd rather sort that out once and implement the desired
 Kevin> semantics in the operators for a new type than to count on
 Kevin> application programmers doing it consistently each time.
 Kevin> Wouldn't you?

No, because the desired semantics are not the same for everyone, so
even if you take just the two examples I gave above, you're already
into combinatorial explosion with four different types needed.

By keeping it as a composite value, you allow the app to define the
semantics it needs.
 
 >>> What if you're storing times of events at specific places; in
 >>> that case you want to associate the timezone with the _place_ not
 >>> the event (so that if the timezone rules change, moving the place
 >>> from one timezone to another, you only have to change the place,
 >>> not all the events that refer to it).
 
 Kevin> I'm not sure I quite followed you there, but HernĂ¡n's example
 Kevin> specifically called for storing 'Chile/Santiago', not a UTC
 Kevin> offset or something as easily changed as the 'CLT' or 'CLST'
 Kevin> time zone designations -- so it is tied to a place rather more
 Kevin> closely than anything else.

But those place definitions do occasionally change. For example, some
US states can change timezone at county level; suppose a state that
was previously all one timezone decides to change timezone or DST
observance for all except a few counties that remain on the previous
setting. So places within those counties will have to change timezone
name from America/Somestate to America/Somestate/Oddcounty while
places in the rest of the state stay with America/Somestate.

The fact that geographic names are used for timezones doesn't mean
that the timezone name applicable to a given place doesn't change;
timezones in the database can split when rule changes happen that
don't affect the full extent of the previous zone; this leads to two
or more zones which have identical definitions up to some date, and
different definitions after it. (Zones can only split, they can't
merge, due to the necessity of keeping historical changes.)

 Kevin> I think that was part of his point -- that for civil time you
 Kevin> care about what the clock on a typical business's wall at that
 Kevin> place will read on that date, regardless of what changes might
 Kevin> happen in time zone definitions.

Right, but if timezone _boundaries_ change, this can't happen without
some manual corrections. (If the timezone _rules_ change without
changing the boundaries, then just updating the tzdata is enough if
you designed the db correctly.)

-- 
Andrew.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to