Re: C locale

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Ara Anjargolian <ara(at)jargol(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: C locale
Date: 2004-03-09 23:22:48
Message-ID: 20040309151808.D7528@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2 Mar 2004, Ara Anjargolian wrote:

> I've been searching the list archives and the web for a while about
> which locale is best used with PostgreSQL and I did not find a
> satisfactory answer so I thought I would ask the list.
>
> Right now my locale is en_US, but with this you can not use standard
> indexes for LIKE queries, so I am left with two options:
>
> 1. User special 'operator class' indexes so that my non-C locale database
> will use indexes
> for like queries.
>
> 2. Reinitialize my database to use the C-locale (not a big deal since I am
> still at a testing
> phase of my project)..
>
>
> I was just wondering if there is any thought as to what is the best
> approach? By switching from en_US to C locales I can avoid using special
> indexes, but what do I lose? I don't really understand what the C
> locale is exactly, so I'm not sure if in switching from en_US to C to
> aviod using operator class indexes something else will stop working.

You may just want to set the LC_COLLATE portion of the locale, but
anyway...

"C" collation is basically byte order collation.
"ab" > "Ab", "a b" > "A Z", "A C" < "AB"

en_US uses something closer to dictionary sorting, so
"a d" < "A Z", "A C" > "AB"

In response to

  • C locale at 2004-03-02 09:37:50 from Ara Anjargolian

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2004-03-09 23:34:36 Re: Shouldn't B'1' = 1::bit be true?
Previous Message Bruce Momjian 2004-03-09 23:18:26 Re: autocommit to off?