Re: BUG #8135: current_setting('DateStyle'); does not reflect User setting

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: frank(at)heuveltop(dot)nl
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8135: current_setting('DateStyle'); does not reflect User setting
Date: 2013-05-06 07:21:46
Message-ID: 51875A0A.5000407@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 05.05.2013 21:18, frank(at)heuveltop(dot)nl wrote:
> PostgreSQL version: 9.1.8

Not that it makes any difference for this issue, but you should upgrade
to 9.1.9.

> After
> ALTER ROLE frank SET TimeZone = 'Europe/Amsterdam';
>
> Where the TimeZone differs from the default timezone.
>
> SELECT current_setting('TimeZone');
>
> Gives the correct answer.
>
> But this same doesn't work for DateStyle
>
> ALTER ROLE frank SET DateStyle = 'SQL, DMY';
>
> Where the DateStyle differs from the default DateStyle
>
> SELECT current_setting('DateStyle');
>
> Gives the system/database setting but not the user setting; while the
> setting does have its effect on the output of date's and timestamps. This
> might also effect other user settings, but I haven't found any yet.

Works for me. Are you sure the value isn't being overridden by a
per-database-and-role setting? You can use "select source from
pg_settings where name='DateStyle'" to check where the currently
effective value came from.

- Heikki

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Patryk Kordylewski 2013-05-06 10:14:42 Inconsistency between TO_CHAR() and TO_NUMBER()
Previous Message Thangalin 2013-05-05 22:54:59 Re: stable vs. immutable unaccent function