Re: [DOCS] LOCAL and TIME ZONE in SET

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: [DOCS] LOCAL and TIME ZONE in SET
Дата
Msg-id CAEfWYywoRpN-c0+kgAn6ZO3zn5M5Z8VYmipnK1435S+FKihsqw@mail.gmail.com
обсуждение исходный текст
Ответ на [DOCS] LOCAL and TIME ZONE in SET  (zszmigiero@gmail.com)
Ответы Re: [DOCS] LOCAL and TIME ZONE in SET  (Zbigniew Szmigiero <zszmigiero@gmail.com>)
Список pgsql-docs


On Tue, Sep 12, 2017 at 11:07 AM, Zbigniew Szmigiero <zszmigiero@gmail.com> wrote:

Hi Steve,

You do not test syntax provided in my examples:

1. ALTER DATABASE name SET TIME ZONE to ‚timezone’

You used TIMEZONE instead of TIME ZONE - please check
Your examples do not match the documentation. That is why they don't work.

TIME<space>ZONE is a special case as detailed at the top of:

Specifically, for "time zone" there is no "to" between "time zone" and the zone name but "local" is a special-case allowed option which is not one of the options for configuration parameters (local would not make sense for most configuration parameters while default usually does).

But "timezone" (no space) is a configuration parameter and *does* require the "to".

Won't work:

steve=# alter database steve set timezone local;
ERROR:  syntax error at or near "local"
LINE 1: alter database steve set timezone local;
                                         ^
steve=# alter database steve set time zone to local;
ERROR:  syntax error at or near "to"
LINE 1: alter database steve set time zone to local;

steve=# alter database steve set timezone 'US/Eastern';    
ERROR:  syntax error at or near "'US/Eastern'"
LINE 1: alter database steve set timezone 'US/Eastern';

steve=# alter database steve set timezone to 'local';
ERROR:  invalid value for parameter "TimeZone": "local"

Will work:

steve=# alter database steve set time zone 'US/Eastern';
ALTER DATABASE

steve=# alter database steve set time zone local;        
ALTER DATABASE

steve=# alter database steve set time zone default;
ALTER DATABASE

steve=# alter database steve set timezone to 'US/Eastern';
ALTER DATABASE 

steve=# alter database steve set timezone to default;
ALTER DATABASE

2. ALTER DATABASE name SET TIMEZONE TO LOCAL generates error - my pg is 9.5.9, please do that with correct privileges, your account was not able execute it.

I know - I was just showing both the privileged and unprivileged attempts.

Cheers,
Steve

В списке pgsql-docs по дате отправления:

Предыдущее
От: devvapp@gmail.com
Дата:
Сообщение: [DOCS] Incorrect result in the Table 9-28. to_char examples
Следующее
От: Zbigniew Szmigiero
Дата:
Сообщение: Re: [DOCS] LOCAL and TIME ZONE in SET