TIMEZONE names

Started by PG Bug reporting formalmost 5 years ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/datatype-datetime.html
Description:

The documentation states that some timezone names are recognized. As far as
I understand others aren't.

This seems to be true:
$psql postgres -c "set TIMEZONE='bug' ; show timezone;"
ERROR: invalid value for parameter "TimeZone": "bug"
$ echo $?
1

However adding a correct numerical offset leads Postgresql to accept a
non-existing timezone name:
$ psql postgres -c "set TIMEZONE='bug-1' ; show timezone;"
$ echo $?
0

Thank you.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: TIMEZONE names

PG Doc comments form <noreply@postgresql.org> writes:

The documentation states that some timezone names are recognized. As far as
I understand others aren't.

There is more detail about that at

https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-TIMEZONES

Note in particular that time zone abbreviations are not considered
valid values for the TimeZone setting. However, once you add a
numeric offset, the string becomes a valid POSIX-style setting.

regards, tom lane

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: TIMEZONE names

On Sat, Jun 12, 2021, 12:28 PG Doc comments form <noreply@postgresql.org>
wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/datatype-datetime.html
Description:

The documentation states that some timezone names are recognized. As far
as
I understand others aren't.

This seems to be true:
$psql postgres -c "set TIMEZONE='bug' ; show timezone;"
ERROR: invalid value for parameter "TimeZone": "bug"
$ echo $?
1

However adding a correct numerical offset leads Postgresql to accept a
non-existing timezone name:
$ psql postgres -c "set TIMEZONE='bug-1' ; show timezone;"
$ echo $?
0

That would be the Appendix B material the documentation is referencing.

David J.

Show quoted text