Re: C locale versus en_US.UTF8. (Was: String comparision in PostgreSQL) - Mailing list pgsql-general

From Aleksey Tsalolikhin
Subject Re: C locale versus en_US.UTF8. (Was: String comparision in PostgreSQL)
Date
Msg-id CA+jMWocm3+_B7cRojHDwytgAmj_PRZmqvTxC94PbORw2YXXq8w@mail.gmail.com
Whole thread Raw
In response to Re: C locale versus en_US.UTF8. (Was: String comparision in PostgreSQL)  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
On Sun, Sep 2, 2012 at 10:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> On Wed, 2012-08-29 at 10:31 -0700, Aleksey Tsalolikhin wrote:
>> What is the difference between C and en_US.UTF8, please?
>
> There are many differences, but here is a simple one:
>
> $ (echo a; echo A; echo b; echo B) | LC_ALL=C sort
> ...
> $ (echo a; echo A; echo b; echo B) | LC_ALL=en_US.utf8 sort
> ...

Beautifully illustrated, and in a language I readily understand as a UNIX
sys admin.  Thank you, Peter!

Thank you, Bruce, Merlin, and everybody else who replied.

I love the flexibility 9.1 allows to have a default sort locale with ability
to alter locale per-query if needed.  It gives us the confidence to move forward
with switching to C for sorting -- right now we only need to sort on US
English data, so this is a perfect fit.  When we internationalize, 9.1
allows us to switch back to UTF8-based sorting if needed.  I love it!

Thank you!
Aleksey


pgsql-general by date:

Previous
From: Aleksey Tsalolikhin
Date:
Subject: Re: Why do I have holes in my pages?
Next
From: Sergey Konoplev
Date:
Subject: Re: Why do I have holes in my pages?