Re: [HACKERS] Timezone List

Lists: pgsql-hackerspgsql-patches
From: Naz Gassiep <naz(at)mira(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Timezone List
Date: 2006-09-06 18:07:58
Message-ID: 44FF0E7E.6030703@mira.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Any chance for a DB Client accessible list of allowable time zones? I've
been told that the only way to get at this list is by looking through
the source and lifting the list from zone.tab.

While I'm at it, how about an accessible list of country codes? I know
that it's not core db functionality, but these lists are so universally
useful that making users parse the files and store them in tables seems
silly.

What are other people's thoughts on this? Good idea or not?


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Naz Gassiep <naz(at)mira(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Timezone List
Date: 2006-09-06 18:20:16
Message-ID: 20060906182016.GC28348@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Thu, Sep 07, 2006 at 04:07:58AM +1000, Naz Gassiep wrote:
> Any chance for a DB Client accessible list of allowable time zones? I've
> been told that the only way to get at this list is by looking through
> the source and lifting the list from zone.tab.

In the CVS version there is a table with this information:

http://developer.postgresql.org/pgdocs/postgres/view-pg-timezonenames.html

> While I'm at it, how about an accessible list of country codes? I know
> that it's not core db functionality, but these lists are so universally
> useful that making users parse the files and store them in tables seems
> silly.

Err, where does postgres use this information? I beleive there is a
project on pgfoundary that has some standard datasets.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


From: Naz Gassiep <naz(at)mira(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Timezone List
Date: 2006-09-06 18:38:18
Message-ID: 44FF159A.7050201@mira.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Martijn van Oosterhout wrote:
> In the CVS version there is a table with this information:
>
> http://developer.postgresql.org/pgdocs/postgres/view-pg-timezonenames.html
>
>
Great, thanks for that
> Err, where does postgres use this information? I beleive there is a
> project on pgfoundary that has some standard datasets.
>
Currently, it is stored in /src/timezone/data/iso3166.tab and I propose
to have it available in a system view or something similar. This data is
as useful as the available timezones, although I concede that it is not
part of PG functionality and this may be more appropriate as a simple
file that can be psql -f'd into the database if users need it as part of
an app. It's more "developer helper data" than "database functionlity"
and hence it could be more appropriate to distribute through the support
community rather than as part of the postgresql core.

Comments?


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Naz Gassiep <naz(at)mira(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Timezone List
Date: 2006-09-06 18:55:01
Message-ID: 22753.1157568901@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Naz Gassiep <naz(at)mira(dot)net> writes:
> Martijn van Oosterhout wrote:
>> Err, where does postgres use this information? I beleive there is a
>> project on pgfoundary that has some standard datasets.
>>
> Currently, it is stored in /src/timezone/data/iso3166.tab and I propose
> to have it available in a system view or something similar.

Hm. I wasn't aware that that was present in the zic database; it's not
something used by or even exposed to the rest of the system. I would
not support adding code that depends on it being there.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Naz Gassiep <naz(at)mira(dot)net>, pgsql-hackers(at)postgresql(dot)org, Joachim Wieland <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-06 19:01:27
Message-ID: 22922.1157569287@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> In the CVS version there is a table with this information:
> http://developer.postgresql.org/pgdocs/postgres/view-pg-timezonenames.html

Actually, what that view gives you is timezone offset abbreviations, not
the full zone names that you could use with SET TIME ZONE. It strikes
me that we should have a view for that as well. We could use code
similar to scan_available_timezones() to generate the view output.

It's somewhat urgent to address this now, because pg_timezonenames is
sitting on the obvious name for such a view, and once we release 8.2
we won't be able to change it. On reflection I think the existing view
is wrongly named --- perhaps it should be pg_timezoneabbrevs? Or
more readably, perhaps pg_timezone_abbrevs, with pg_timezone_names for
the other view.

regards, tom lane


From: Naz Gassiep <naz(at)mira(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org, Joachim Wieland <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-06 19:29:04
Message-ID: 44FF2180.5040202@mira.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches


> Actually, what that view gives you is timezone offset abbreviations, not
> the full zone names that you could use with SET TIME ZONE. It strikes
> me that we should have a view for that as well. We could use code
> similar to scan_available_timezones() to generate the view output.
>
> It's somewhat urgent to address this now, because pg_timezonenames is
> sitting on the obvious name for such a view, and once we release 8.2
> we won't be able to change it. On reflection I think the existing view
> is wrongly named --- perhaps it should be pg_timezoneabbrevs? Or
> more readably, perhaps pg_timezone_abbrevs, with pg_timezone_names for
> the other view.
>
> regards, tom lane
>
I agree with having two views, and I also think that the name as it is,
is not right. I agree with pg_timezone_abbrevs and pg_timezone_names or
similar.

On a related note, there is not a one:one relationship between
abbreviations and zone names, some abbreviations are used by two zones
(forex "EST", "CST" and others are used in Australia and the Americas)
and currently it is a server configuration directive
(australian_timezones) to assume Australian or American zones in the
case of ambiguity.

I don't know about anyone else, but the whole australian_timezones thing
seems like an ugly hackaround to me. I do not have a proposed solution
to this, but I see a non-trivial risk of an application being
re-deployed on a server where the admin forgets to change this directive
resulting in all kinds of fun and games. Forgive me if this is an
already-discussed issue.

I am also rather baffled at the way "SAT" is changed from being
interpreted as a day of the week in one mode, and a timezone in another.
This seems an awful incongruity of behavior, and "SAT" should be
interpreted as a timezone in both modes. If it must be done, switching
of this behavior doesn't fit in with the purpose of the
australian_timezones directive and should be made the subject of a
different directive (e.g., sat_is_timezone(boolean) or something
similar). SAT should, IMHO, always be considered a timezone and use of
the "SAT" string by DB programmers should be just another case for care
as with any other SQL keyword.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Naz Gassiep <naz(at)mira(dot)net>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org, Joachim Wieland <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-06 19:34:50
Message-ID: 23566.1157571290@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Naz Gassiep <naz(at)mira(dot)net> writes:
> I don't know about anyone else, but the whole australian_timezones thing
> seems like an ugly hackaround to me.

You really shouldn't be pontificating about this if you haven't been
paying attention to recent development work ;-)

regards, tom lane


From: Naz Gassiep <naz(at)mira(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-hackers(at)postgresql(dot)org, Joachim Wieland <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-06 19:41:48
Message-ID: 44FF247C.8020902@mira.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

>
>> I don't know about anyone else, but the whole australian_timezones thing
>> seems like an ugly hackaround to me.
>>
>
> You really shouldn't be pontificating about this if you haven't been
> paying attention to recent development work ;-)
>
> regards, tom lane

Aah, sorry, I don't watch dev progress very closely. This is something
that has been bugging me since 7.4.x branch and I never got around to
whining about it. Consider my comments retracted.

- Naz


From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: "Naz Gassiep" <naz(at)mira(dot)net>, <pgsql-hackers(at)postgresql(dot)org>, "Joachim Wieland" <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-06 21:10:49
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0FB8E@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> > In the CVS version there is a table with this information:
> >
> http://developer.postgresql.org/pgdocs/postgres/view-pg-timezonenames.
> > html
>
> Actually, what that view gives you is timezone offset
> abbreviations, not the full zone names that you could use
> with SET TIME ZONE. It strikes me that we should have a view
> for that as well. We could use code similar to
> scan_available_timezones() to generate the view output.

You know, I think I suggested that back in the days when I worked on the
replacement timezone code, and you didn't want it back then ;-) If you
think it's good now then yes, I still think it is. I may even have the
code for it around somewhere if I go look a bit...

Assuming we can sneak this in even though it's feature-freeze, want me
to look for it?

> It's somewhat urgent to address this now, because
> pg_timezonenames is sitting on the obvious name for such a
> view, and once we release 8.2 we won't be able to change it.
> On reflection I think the existing view is wrongly named ---
> perhaps it should be pg_timezoneabbrevs? Or more readably,
> perhaps pg_timezone_abbrevs, with pg_timezone_names for the
> other view.

Seems reasonable - my vote is for the more readable version.

//Magnus


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Naz Gassiep <naz(at)mira(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, Joachim Wieland <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-06 21:12:08
Message-ID: 20060906211208.GD28348@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Thu, Sep 07, 2006 at 05:29:04AM +1000, Naz Gassiep wrote:
> I am also rather baffled at the way "SAT" is changed from being
> interpreted as a day of the week in one mode, and a timezone in another.

Ugh. It'd be an argument if people actually used SAT as a timezone.
They don't, it's ACST.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Naz Gassiep" <naz(at)mira(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Joachim Wieland" <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-06 22:06:43
Message-ID: 25594.1157580403@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
> Assuming we can sneak this in even though it's feature-freeze, want me
> to look for it?

Yeah, please take a look --- seeing the size of the code will probably
help us decide if it's too late for 8.2 or not.

regards, tom lane


From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Timezone List
Date: 2006-09-07 00:32:26
Message-ID: slrnefuq4p.2ea3.andrew+nonews@atlantis.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On 2006-09-06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
>> In the CVS version there is a table with this information:
>> http://developer.postgresql.org/pgdocs/postgres/view-pg-timezonenames.html
>
> Actually, what that view gives you is timezone offset abbreviations, not
> the full zone names that you could use with SET TIME ZONE. It strikes
> me that we should have a view for that as well. We could use code
> similar to scan_available_timezones() to generate the view output.

Any view over the full timezone names should also include the corresponding
data from zone.tab in the timezone library source.

> It's somewhat urgent to address this now, because pg_timezonenames is
> sitting on the obvious name for such a view, and once we release 8.2
> we won't be able to change it. On reflection I think the existing view
> is wrongly named --- perhaps it should be pg_timezoneabbrevs? Or
> more readably, perhaps pg_timezone_abbrevs, with pg_timezone_names for
> the other view.

Yes, the abbreviations table is definitely misnamed.

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Naz Gassiep <naz(at)mira(dot)net>, pgsql-hackers(at)postgresql(dot)org, Joachim Wieland <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-07 00:38:32
Message-ID: Pine.LNX.4.58.0609071037100.13384@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Wed, 6 Sep 2006, Tom Lane wrote:

> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > In the CVS version there is a table with this information:
> > http://developer.postgresql.org/pgdocs/postgres/view-pg-timezonenames.html
>
> Actually, what that view gives you is timezone offset abbreviations, not
> the full zone names that you could use with SET TIME ZONE. It strikes
> me that we should have a view for that as well. We could use code
> similar to scan_available_timezones() to generate the view output.
>
> It's somewhat urgent to address this now, because pg_timezonenames is
> sitting on the obvious name for such a view, and once we release 8.2
> we won't be able to change it. On reflection I think the existing view
> is wrongly named --- perhaps it should be pg_timezoneabbrevs? Or
> more readably, perhaps pg_timezone_abbrevs, with pg_timezone_names for
> the other view.

I think 'abbrev' is a like unintuitive. How about 'short_names'?

Gavin


From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Naz Gassiep" <naz(at)mira(dot)net>, <pgsql-patches(at)postgresql(dot)org>, "Joachim Wieland" <joe(at)mcknight(dot)de>
Subject: Re: [HACKERS] Timezone List
Date: 2006-09-07 12:33:29
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA3565C@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> > Assuming we can sneak this in even though it's feature-freeze,
> want me
> > to look for it?
>
> Yeah, please take a look --- seeing the size of the code will
> probably help us decide if it's too late for 8.2 or not.

Here goes. Tested only on win32 so far, but works there. No docs yet
either - need to know if it goes in first ;)

It only returns the name, but if you want more funky stuff you can do
things like

select name,current_timestamp at time zone name from pg_timezone_names

//Magnus

Attachment Content-Type Size
pg_timezone_names.diff application/octet-stream 11.2 KB

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Naz Gassiep" <naz(at)mira(dot)net>, <pgsql-patches(at)postgresql(dot)org>, "Joachim Wieland" <joe(at)mcknight(dot)de>
Subject: Re: [HACKERS] Timezone List
Date: 2006-09-07 12:34:33
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA3565D@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> > > Assuming we can sneak this in even though it's feature-freeze,
> > want me
> > > to look for it?
> >
> > Yeah, please take a look --- seeing the size of the code will
> probably
> > help us decide if it's too late for 8.2 or not.
>
> Here goes. Tested only on win32 so far, but works there. No docs
> yet either - need to know if it goes in first ;)
>
> It only returns the name, but if you want more funky stuff you can
> do things like
>
> select name,current_timestamp at time zone name from
> pg_timezone_names

Oh, and it's going to need an update to expected/rules.out, not included
in the patch, as well.

//Magnus


From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: <andrew(at)supernews(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Timezone List
Date: 2006-09-07 12:37:09
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA3565E@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

> >> In the CVS version there is a table with this information:
> >> http://developer.postgresql.org/pgdocs/postgres/view-pg-
> timezonenames
> >> .html
> >
> > Actually, what that view gives you is timezone offset
> abbreviations,
> > not the full zone names that you could use with SET TIME ZONE.
> It
> > strikes me that we should have a view for that as well. We could
> use
> > code similar to scan_available_timezones() to generate the view
> output.
>
> Any view over the full timezone names should also include the
> corresponding data from zone.tab in the timezone library source.

Just noticed this mail, so that's not included in my patch. But couldn't
we just load that file up in a separate table if needed, and then join
with it when necessary?

//Magnus


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Naz Gassiep <naz(at)mira(dot)net>, pgsql-hackers(at)postgresql(dot)org, Joachim Wieland <joe(at)mcknight(dot)de>
Subject: Re: Timezone List
Date: 2006-09-07 14:59:16
Message-ID: 5545.1157641156@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> On Wed, 6 Sep 2006, Tom Lane wrote:
>> It's somewhat urgent to address this now, because pg_timezonenames is
>> sitting on the obvious name for such a view, and once we release 8.2
>> we won't be able to change it. On reflection I think the existing view
>> is wrongly named --- perhaps it should be pg_timezoneabbrevs? Or
>> more readably, perhaps pg_timezone_abbrevs, with pg_timezone_names for
>> the other view.

> I think 'abbrev' is a like unintuitive. How about 'short_names'?

I'm not wedded to "abbrevs", but I don't like "short_names" because it
suggests that the names in the one view are just shorter forms of the
names in the other view, whereas really they aren't comparable things
at all (eg, EDT and EST5EDT are very different animals, because the
latter includes a set of DST transition-date rules).

I suppose the same argument could be made against "abbrevs" of course,
but it seems stronger if we have "names" and "short_names".

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org, "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Naz Gassiep" <naz(at)mira(dot)net>, pgsql-patches(at)postgresql(dot)org, "Joachim Wieland" <joe(at)mcknight(dot)de>
Subject: Re: [HACKERS] Timezone List
Date: 2006-09-16 20:19:48
Message-ID: 12862.1158437988@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
>>> Assuming we can sneak this in even though it's feature-freeze,
>>> want me to look for it?

>> Yeah, please take a look --- seeing the size of the code will
>> probably help us decide if it's too late for 8.2 or not.

> Here goes. Tested only on win32 so far, but works there. No docs yet
> either - need to know if it goes in first ;)

I've applied this along with some extra work to get it to show GMT
offsets and DST status, which should be useful for helping people
to choose which setting they want. This effectively obsoletes
Table B-5 as well as B-4 in the SGML docs ... we should probably
remove both of those in favor of recommending people look at the
views.

I did the basic documentation work in catalogs.sgml for these views,
but Appendix B still needs an update. Joachim, you were going to do
that, right?

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: andrew(at)supernews(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Timezone List
Date: 2006-09-17 02:31:48
Message-ID: 15778.1158460308@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
>> Any view over the full timezone names should also include the
>> corresponding data from zone.tab in the timezone library source.

> Just noticed this mail, so that's not included in my patch.

BTW, now that the view is in, I can't help noticing that it shows 550
different zone names, while there are only 392 entries in the zone.tab
file. I conclude that the zic people don't take maintenance of zone.tab
very seriously, and hence that we probably shouldn't rely on it.

regards, tom lane


From: Joachim Wieland <joe(at)mcknight(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <mha(at)sollentuna(dot)net>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Naz Gassiep <naz(at)mira(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Timezone List
Date: 2006-09-17 09:49:51
Message-ID: 20060917094951.GA3157@mcknight.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Sat, Sep 16, 2006 at 04:19:48PM -0400, Tom Lane wrote:
> I've applied this along with some extra work to get it to show GMT
> offsets and DST status, which should be useful for helping people
> to choose which setting they want. This effectively obsoletes
> Table B-5 as well as B-4 in the SGML docs ... we should probably
> remove both of those in favor of recommending people look at the
> views.

> I did the basic documentation work in catalogs.sgml for these views,
> but Appendix B still needs an update. Joachim, you were going to do
> that, right?

Thats right.

Joachim

--
Joachim Wieland joe(at)mcknight(dot)de
GPG key available


From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Timezone List
Date: 2006-09-17 14:57:20
Message-ID: slrnegqoif.2ea3.andrew+nonews@atlantis.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On 2006-09-17, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
>>> Any view over the full timezone names should also include the
>>> corresponding data from zone.tab in the timezone library source.
>
>> Just noticed this mail, so that's not included in my patch.
>
> BTW, now that the view is in, I can't help noticing that it shows 550
> different zone names, while there are only 392 entries in the zone.tab
> file. I conclude that the zic people don't take maintenance of zone.tab
> very seriously, and hence that we probably shouldn't rely on it.

You're jumping to conclusions there.

Eliminating the alias names (i.e. anything not in the form Continent/*),
we get only 45 differences, of which 40 are backward-compatibility aliases
(see the "backward" source file). The remaining five are:

Asia/Riyadh87
Asia/Riyadh88
Asia/Riyadh89 (the three Riyadh?? zones are local solar time for specific
years)
Asia/Istanbul (alias for Europe/Istanbul)
Europe/Nicosia (alias for Asia/Nicosia)

So the list in zone.tab _is_ complete, it just doesn't list aliases (which
it isn't supposed to). The reason to include zone.tab in with the data
(unlike the current setup which doesn't bother to even install the file
anywhere) is to provide an answer to the question "what timezone(s) are
applicable to a specific country". For that purpose aliases are irrelevent.

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


From: Joachim Wieland <joe(at)mcknight(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Magnus Hagander <mha(at)sollentuna(dot)net>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Naz Gassiep <naz(at)mira(dot)net>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Timezone List
Date: 2006-09-19 10:05:54
Message-ID: 20060919100554.GA3069@mcknight.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-patches

On Sat, Sep 16, 2006 at 04:19:48PM -0400, Tom Lane wrote:
> "Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
> > Here goes. Tested only on win32 so far, but works there. No docs yet
> > either - need to know if it goes in first ;)

> I've applied this along with some extra work to get it to show GMT
> offsets and DST status, which should be useful for helping people
> to choose which setting they want. This effectively obsoletes
> Table B-5 as well as B-4 in the SGML docs ... we should probably
> remove both of those in favor of recommending people look at the
> views.

http://momjian.us/main/writings/pgsql/sgml/view-pg-timezone-names.html says
that the names in the view are "recognized" as argument to "SET TIMEZONE".
However some of them can still not be used if they contain leap seconds, try
for example

set timezone to 'Mideast/Riyadh87';

Should we just document that some can't be set or remove those from the view
completely or add another boolean column has_leapsecs or similar?

Removing them seems not to be the right idea because you can say:

select now() at time zone 'Mideast/Riyadh87';

Joachim

--
Joachim Wieland joe(at)mcknight(dot)de
GPG key available