Re: Default Locale in initdb - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Default Locale in initdb
Date
Msg-id 40BE2278.80903@dunslane.net
Whole thread Raw
In response to Re: Default Locale in initdb  (Paul Ramsey <pramsey@refractions.net>)
List pgsql-hackers
Paul Ramsey wrote:

> Just because it is not new does not mean that it is good.



Sure. I've been caught by it too. Once. :-)

>
> When this new behavior was introduced, and I migrated our databases to 
> the new PgSQL version (dump/restore), the locale of all my databases 
> were silently changed from C to US_en. This broke one application in a 
> very subtle way because of slightly different sort behavior in the 
> different locale. Tracking it down was quite tricky.
>
> PgSQL was just a little too helpful in this case.


It doesn't happen silently - initdb tells you what it is doing.

Ignoring the current environment and using a default value of "C" would 
be a very simple change to make, if that's what people want.

cheers

andrew


>
> Andrew Dunstan wrote:
>
>> pgsql@mohawksoft.com wrote:
>>
>>> Is it me or has the default locale of created databases change at 
>>> some point?
>>>
>>> Currently, on Linux, if one does not specify a locale, the locale is 
>>> taken
>>> from the system environment and it is not "C."
>>>
>>> While I can both sides of a discussion, I think that choosing a 
>>> "locale"
>>> without one being specified is a bad idea, even if it is the locale 
>>> of the
>>> machine. The reason why it is a bad idea is that certain features of 
>>> the
>>> database which only work correctly with a locale of "C" will not 
>>> work by
>>> default.
>>
>>
>> This is not new behaviour.
>>
>> (Why are you the only person who posts here who is nameless?)
>>
>> cheers
>>
>> andrew
>
>
>



pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Default Locale in initdb
Next
From: Harald Fuchs
Date:
Subject: Re: Converting postgresql.conf parameters to kilobytes