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

Lists: pgsql-bugs
From: "Sangmin Ryu" <neocoin(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5658: 'at time zone {timezone description}' can't recognize many time zone abbreviations.
Date: 2010-09-15 18:36:03
Message-ID: 201009151836.o8FIa3mG002704@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5658
Logged by: Sangmin Ryu
Email address: neocoin(at)gmail(dot)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';


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Sangmin Ryu" <neocoin(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5658: 'at time zone {timezone description}' can't recognize many time zone abbreviations.
Date: 2010-09-15 19:15:59
Message-ID: 23170.1284578159@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Sangmin Ryu" <neocoin(at)gmail(dot)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