X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 77F27476533 for ; Wed, 7 May 2003 16:33:33 -0400 (EDT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id 6DB20476460 for ; Wed, 7 May 2003 16:33:32 -0400 (EDT) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 19DVbZ-0003Hs-0Z; Wed, 07 May 2003 21:33:33 +0100 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 19DVbY-0005oD-00; Wed, 07 May 2003 21:33:32 +0100 Subject: Re: locale support From: Oliver Elphick To: Jodi Kanter Cc: Postgres Admin List In-Reply-To: <3EB95FDC.70609@virginia.edu> References: <3EB95FDC.70609@virginia.edu> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1052339612.21368.34.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 07 May 2003 21:33:32 +0100 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-45.1 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,SIGNATURE_LONG_DENSE, USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/86 X-Sequence-Number: 8648 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