pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Jodi Kanter <jkanter@virginia.edu>
Cc: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: locale support
Date: 07 May 2003 21:33:32 +0100
Message-ID: <1052339612.21368.34.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <3EB95FDC.70609@virginia.edu>
References: <3EB95FDC.70609@virginia.edu>

On Wed, 2003-05-07 at 20:34, Jodi Kanter wrote:
> Just a simple question regarding which locale setting applies to which
> type of sorting. I have two machines, production and development. The
> development machine has LC_COLLATE and LC_CTYPE set to C and the other
> has them both set to en_US. 
> We originally changed the development machine from en_US to C because
> we were having a problem with spaces being sorted in correctly. That
> has been fixed on the development box, but I now noticed it is sorting
> lower case letters after all capital letters. I would prefer that case
> is ignored when alphabetical sorts are completed. This type of sort is
> working correctly on the machine where both locales are set to en_US.
> Does this mean that one of the above mentioned locales needs to be set
> back to en_US? I would like to have case ignored but I want to be
> careful not to mess up the sorting of spaces, which we have already
> fixed. I hate to have to test on my own and then have to reinitialize
> more than once! Please advise if you can.

The sorting characteristics of C are strict ASCII order, spaces
significant.

The characteristics of en_* are dictionary order, more spaces sort after
fewer spaces:

        $ LANG=en_GB sort /tmp/ol
        fredbrooks
        fred brooks
        Fredbrooks
        Fred Brooks
        Fred  Brooks
        FredBuck
        Fred Buck
        Fred  Buck
        
        $ LANG=C sort /tmp/ol
        Fred  Brooks
        Fred  Buck
        Fred Brooks
        Fred Buck
        FredBuck
        Fredbrooks
        fred brooks
        fredbrooks

So I suspect that if you want a mixture of these characteristics, you
will have to write your own locale. Don't ask me how...

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Dearly beloved, avenge not yourselves, but rather give
      place unto wrath. For it is written, Vengeance is 
      mine; I will repay, saith the Lord. Therefore if thine
      enemy hunger, feed him; if he thirst, give him drink;
      for in so doing thou shalt heap coals of fire on his 
      head. Be not overcome of evil, but overcome evil with 
      good."      Romans 12:19-21 




view thread (6+ messages)

Message-ID: <1052339612.21368.34.camel@linda.lfix.co.uk>
Permalink:  ../1052339612.21368.34.camel@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/1052339612.21368.34.camel@linda.lfix.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: olly@lfix.co.uk, jkanter@virginia.edu
  Subject: Re: locale support
  In-Reply-To: <1052339612.21368.34.camel@linda.lfix.co.uk>
  References: <3EB95FDC.70609@virginia.edu> <1052339612.21368.34.camel@linda.lfix.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox