Re: LOCAL and TIME ZONE in SET

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: zszmigiero(at)gmail(dot)com, "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Re: LOCAL and TIME ZONE in SET
Date: 2017-09-11 16:02:51
Message-ID: CAKFQuwZgpkoDgxCPp-2Kcmie6LMX5F0vumG8Z29qXMkbUM=rVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Mon, Sep 11, 2017 at 8:26 AM, Steve Crawford <
scrawford(at)pinpointresearch(dot)com> wrote:

> On Fri, Sep 8, 2017 at 1:05 PM, <zszmigiero(at)gmail(dot)com> wrote:
>
>> The following documentation comment has been logged on the website:
>>
>> Page: https://www.postgresql.org/docs/9.5/static/sql-alterdatabase.html
>> Description:
>>
>> The &quot;ALTER DATABASE name TIME ZONE ...&quot; is rejected
>>
>> THE &quot;ALTER DATABASE name TIMEZONE TO LOCAL&quot; is rejected
>>
>> Please update documentation or provide correct syntax
>>
>>
> It works as described in the documentation:
>
> steve=> alter database steve set timezone to local;
> ERROR: must be owner of database steve
>
> postgres=# alter database steve set timezone to 'US/Pacific';
> ALTER DATABASE
> postgres=# alter database steve set timezone to default;
> ALTER DATABASE
>
>
​More specifically the first listed syntax only applies if the inherent
database "option" you wish to ​set is one of:
ALLOW_CONNECTIONS allowconn
CONNECTION LIMIT connlimit
IS_TEMPLATE istemplate

What you want to do is setup a default User-Database Configuration (GUC)
value (which in this case applies to all users connecting to this
database); which is what the last 4 syntax specifications pertain to - as
noted in the description section on that page.

18.1.3 describes this dynamic in more detail:

https://www.postgresql.org/docs/9.5/static/config-setting.html#CONFIG-SETTING-SQL-COMMAND-INTERACTION

David J.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message devvapp 2017-09-11 20:55:54 Incorrect result in the Table 9-28. to_char examples
Previous Message Steve Crawford 2017-09-11 15:26:54 Re: LOCAL and TIME ZONE in SET