Re: timezones to own config file

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: timezones to own config file
Date: 2006-05-25 01:13:42
Message-ID: 6919.1148519622@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joachim Wieland <joe(at)mcknight(dot)de> writes:
> I'd like to know what exactly is to be done for this TODO-item
> o Allow customization of the known set of TZ names (generalize the
> present australian_timezones hack)

Well, part of the TODO is to figure out exactly what to do ;-)

> So we'd need a file specifying time zone abbreviations and their offsets, so
> for example a file containing lines like:
> XST -3.25 # comment here for Xtended Standard Time

That's the basic idea. It strikes me that there are going to be certain
groups of settings that go together, ie, folks in North America are
going to know what they want, the Aussies will know what they want but
it'll be different, etc. I was toying with the idea that what we should
have is a postgresql.conf setting that points at a particular file
containing TZ names. Then you could imagine that the standard distro
installs

{prefix}/share/tznames/americas
{prefix}/share/tznames/australia
{prefix}/share/tznames/fareast

and in postgresql.conf you put

tznames = australia

or if you live somewhere well and truly off the beaten track, you make
your own tznames file, put it in that directory, and specify it in
postgresql.conf. But 99% of users should not have to do that --- they
should be able to select an already-configured tzname set and have it
Do What They Want.

But that's just one idea. Feel free to propose something else.

> I wondered especially if there was a need to associate the abbreviation in
> some way to the entries from the zic database but datetime.c seems to just
> add or subtract the offset and save the resulting time without further time
> zone information.

The zic database doesn't seem to have a problem with using the same
abbreviations to mean many different things. We could look to it for
information, or maybe even use its classification of timezone groups,
but I don't think it can solve the problem for us.

I think you may be thinking of yet a separate TODO item, which is to
be able to use the zic timezone names in timestamptz input, viz
'2006-05-24 21:11 Americas/New_York'::timestamptz
But names like 'IST' or 'CDT' are not zic timezone names, they just
represent specific offsets from UTC.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-05-25 02:33:53 Gborg and pgfoundry
Previous Message Richard 2006-05-25 00:55:29 Re: v814 + OSX10.4.6 builds OK, but fails launch ...