Обсуждение: BUG #5658: 'at time zone {timezone description}' can't recognize many time zone abbreviations.

Поиск
Список
Период
Сортировка

BUG #5658: 'at time zone {timezone description}' can't recognize many time zone abbreviations.

От
"Sangmin Ryu"
Дата:
The following bug has been logged online:

Bug reference:      5658
Logged by:          Sangmin Ryu
Email address:      neocoin@gmail.com
PostgreSQL version: 8.3, 8.4.4
Operating system:   Ubuntu 8.04 , Ubuntu 10.04
Description:        'at time zone {timezone description}' can't recognize
many time zone abbreviations.
Details:

'at time zone {timezone description}' don't recognize many time zone
abbreviations.

Recently, my user request 'WIT' time zone.

---------------------------------------------------
postgres=# select current_timestamp at time zone 'PDT';
          timezone
----------------------------
 2010-09-15 11:32:28.449011
(1 row
postgres=# select current_timestamp at time zone 'WIT';
ERROR:  time zone "WIT" not recognized

postgres=# select * from pg_timezone_names where abbrev = 'WIT';
         name         | abbrev | utc_offset | is_dst
----------------------+--------+------------+--------
 posix/Asia/Pontianak | WIT    | 07:00:00   | f
 posix/Asia/Jakarta   | WIT    | 07:00:00   | f
 Asia/Pontianak       | WIT    | 07:00:00   | f
 Asia/Jakarta         | WIT    | 07:00:00   | f
(4 rows)

----------------------------------------------------

I checked changes version 7.x to 8.x. I found many timezone feature was
added at postgres version 8.x.

Maybe, 8.x version 'at time zone' keyword can recognize 7.x supported
abbreviations.


For example.

select current_timestamp at time zone 'zzz';

Re: BUG #5658: 'at time zone {timezone description}' can't recognize many time zone abbreviations.

От
Tom Lane
Дата:
"Sangmin Ryu" <neocoin@gmail.com> writes:
> 'at time zone {timezone description}' don't recognize many time zone
> abbreviations.

This is configurable.  See
http://www.postgresql.org/docs/8.4/static/datetime-config-files.html

In general our intent is not to try to put every timezone abbreviation
in the world into the default list of abbreviations.  That would mostly
have the effect of losing error-checking capability.  It's better to
have a fairly short list of abbreviations your users might actually use.

            regards, tom lane