Re: C locale versus en_US.UTF8. (Was: String comparision in PostgreSQL)

From: Aleksey Tsalolikhin <atsaloli(dot)tech(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: C locale versus en_US.UTF8. (Was: String comparision in PostgreSQL)
Date: 2012-09-21 21:26:07
Message-ID: CA+jMWocm3+_B7cRojHDwytgAmj_PRZmqvTxC94PbORw2YXXq8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Sep 2, 2012 at 10:08 PM, Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Walter Hurry 2012-09-21 22:25:49 Re: Windows Services and Postgresql 9.1.3
Previous Message Aleksey Tsalolikhin 2012-09-21 21:08:33 Re: Why do I have holes in my pages?