Thread: Re: [HACKERS] Timezone List

Re: [HACKERS] Timezone List

From
"Magnus Hagander"
Date:
> > 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

Re: [HACKERS] Timezone List

From
"Magnus Hagander"
Date:
> > > 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

Re: [HACKERS] Timezone List

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.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

Re: [HACKERS] Timezone List

From
Joachim Wieland
Date:
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@mcknight.de
                                                           GPG key available

Re: [HACKERS] Timezone List

From
Joachim Wieland
Date:
On Sat, Sep 16, 2006 at 04:19:48PM -0400, Tom Lane wrote:
> "Magnus Hagander" <mha@sollentuna.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@mcknight.de
                                                           GPG key available