Re: setting time zone in a function
| От | Tom Lane |
|---|---|
| Тема | Re: setting time zone in a function |
| Дата | |
| Msg-id | 11976.1461251982@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: setting time zone in a function (Steve Rogerson <steve.pg@yewtc.demon.co.uk>) |
| Список | pgsql-general |
Steve Rogerson <steve.pg@yewtc.demon.co.uk> writes: > I wonder what counts as a valid time zone http://www.postgresql.org/docs/9.5/static/datatype-datetime.html#DATATYPE-TIMEZONES > ... I wasn't expecting this: > # set timezone = '==2.77'; > SET > # select now(); > now > ------------------------------- > 2016-04-18 09:40:52.089375-77 > (1 row) Postgres is *very* lax about what is a valid timezone abbreviation in the POSIX notation, mainly because the underlying Olson code is too. I think it's taking that as '==' being the standard zone abbreviation and '.' being the DST zone abbreviation. If you wanted to restrict input to be the Olson-style zone names, you could do some kind of precheck, maybe insist on only letters/ slashes/underscores. regards, tom lane
В списке pgsql-general по дате отправления: