Re: set timestamp oddness - Mailing list pgsql-general

From Tom Lane
Subject Re: set timestamp oddness
Date
Msg-id 19235.1081227030@sss.pgh.pa.us
Whole thread Raw
In response to set timestamp oddness  (Will Trillich <will@serensoft.com>)
List pgsql-general
Will Trillich <will@serensoft.com> writes:
>     db=# set timezone = '-6';
>     SET
>     db=# show timezone;
>         TimeZone
>     ----------------
>      -00:00:00.0216
>     (1 row)

hmm ... I get something reasonable here:

regression=# set timezone = '-6';
SET
regression=# show timezone;
 TimeZone
-----------
 -06:00:00
(1 row)

Could you poke into this more and find out why it goes wrong on your
platform?

>     db=# set timezone to '-5:00';
>     ERROR:  unrecognized time zone name: "-5:00"

That one works for me too...

> the one that "set time zone" does NOT accept, "at time zone" DOES.
> hmm?

This is not totally surprising, seeing that they go through completely
different code paths.  I believe "set time zone" accepts whatever the
underlying OS's tzset() routine will take, whereas "at time zone"
only accepts timezone names listed in datetime.c's builtin table.
The difference could and someday should be eliminated, but it will
take rewriting a lot of OS-level timezone support for ourselves :-(

            regards, tom lane

pgsql-general by date:

Previous
From: David Wheeler
Date:
Subject: pg_autovacuum won't make on FreeBSD
Next
From: Bruce Momjian
Date:
Subject: Re: psql's "\d" and CLUSTER