storing TZ along timestamps - Mailing list pgsql-hackers

From Alvaro Herrera
Subject storing TZ along timestamps
Date
Msg-id 1306528155-sup-8852@alvh.no-ip.org
Whole thread Raw
Responses Re: storing TZ along timestamps  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: storing TZ along timestamps  ("David E. Wheeler" <david@kineticode.com>)
Re: storing TZ along timestamps  (Steve Crawford <scrawford@pinpointresearch.com>)
Re: storing TZ along timestamps  (tomas@tuxteam.de)
Re: storing TZ along timestamps  (Jeff Davis <pgsql@j-davis.com>)
Re: storing TZ along timestamps  (Jeff Davis <pgsql@j-davis.com>)
Re: storing TZ along timestamps  (Alexey Klyukin <alexk@commandprompt.com>)
List pgsql-hackers
Hi,

One of our customers is interested in being able to store original
timezone along with a certain timestamp.

It is currently possible to store a TZ in a separate column, but this is
a bit wasteful and not very convenient anyway.

There are all sorts of UI issues that need to be resolved in order for
this to be a complete feature proposal, but the first thing that we
discussed was what is the storage going to look like.  Of course, one
thing we don't want is to store the complete TZ name as text.

So the first thing is cataloguing timezone names, and assigning an ID to
each (maybe an OID).  If we do that, then we can store the OID of the
timezone name along the int64/float8 of the actual timestamp value.

Right now we rely on the tzdata files on disk for things like
pg_timezone_names and other accesses of TZ data; so the files are the
authoritative source of TZ info.  So we need to ensure that whenever the
files are updated, the catalogs are updated as well.  
I think we could make this work if we "refreshed" the catalog from the
files on SIGHUP if the directory changes (say, a new timezone is
created).  Note that I am currently proposing to store only the zone
names in the catalog, not the full TZ data.

Are there objections to the general idea?  If not, I'll flesh a more
complete proposal.

-- 
Álvaro Herrera <alvherre@commandprompt.com>


pgsql-hackers by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: tackling full page writes
Next
From: Robert Haas
Date:
Subject: Re: Reducing overhead of frequent table locks