Re: Mixed Locales and Upgrading - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Mixed Locales and Upgrading
Date
Msg-id 6bcc201e-e3da-329b-ca7f-d90c9986a769@aklaver.com
Whole thread Raw
In response to Re: Mixed Locales and Upgrading  (Don Seiler <don@seiler.us>)
Responses Re: Mixed Locales and Upgrading
List pgsql-general
On 4/29/20 1:10 PM, Don Seiler wrote:
> On Tue, Apr 7, 2020 at 11:41 AM Don Seiler <don@seiler.us 
> <mailto:don@seiler.us>> wrote:
> 
> 
>     Follow-up question, the locale setting on the host would still be
>     set to en_US (as would the postgres and template0 databases). Should
>     I look to change that locale on the system to en_US.UTF-8, or even
>     just for the postgres user that the DB cluster runs as? What are the
>     ramification for doing (or not doing) so?
> 
> 
> One more question around the GUC settings for locale. It is currently 
> set to this:
> 
> # select name,setting from pg_settings where name like 'lc%';
>      name     | setting
> -------------+---------
>   lc_collate  | en_US
>   lc_ctype    | en_US
>   lc_messages |
>   lc_monetary | C
>   lc_numeric  | C
>   lc_time     | C
> 
> Since I'm not changing the postgres or template0 databases (leaving 
> those as en_US/LATIN1), do I keep lc_collate/lc_ctype as en_US? It's 
> just the template1 and application database that I've set to en_US.UTF-8.
> 
> I'm also struggling to see how lc_messages is an empty string. It is 
> commented out in postgresql.conf but suggests 'C' will be the default. 

Are you sure?:

https://www.postgresql.org/docs/12/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT
"lc_messages (string)

     Sets the language in which messages are displayed. Acceptable 
values are system-dependent; see Section 23.1 for more information. If 
this variable is set to the empty string (which is the default) then the 
value is inherited from the execution environment of the server in a 
system-dependent way. ..."

> The OS locale LC_MESSAGES is set to en_US on the primary but I also see 
> it is set to en_US on the newer replica hosts. What value would be used 
> for lc_messages? I'm trying to create an empty DB with these same 
> settings but if I omit --lc-messages it uses the OS locale value, and I 
> can't set it to an empty string.
> 
> Don.
> 
> -- 
> Don Seiler
> www.seiler.us <http://www.seiler.us>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Don Seiler
Date:
Subject: Re: Mixed Locales and Upgrading
Next
From: Tom Lane
Date:
Subject: Re: Mixed Locales and Upgrading