X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1E8ED3A596C for ; Thu, 2 Dec 2004 21:42:24 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22149-04 for ; Thu, 2 Dec 2004 21:42:19 +0000 (GMT) Received: from www.postgresql.com (unknown [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id EF1A53A5998 for ; Thu, 2 Dec 2004 21:41:43 +0000 (GMT) Received: from anchor-post-36.mail.demon.net (anchor-post-36.mail.demon.net [194.217.242.86]) by www.postgresql.com (Postfix) with ESMTP id C5E6B73B437 for ; Thu, 2 Dec 2004 09:05:04 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-36.mail.demon.net with esmtp (Exim 4.42) id 1CZmsQ-000KBG-MD; Thu, 02 Dec 2004 09:03:51 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 2915F162AD; Thu, 2 Dec 2004 09:03:50 +0000 (GMT) Message-ID: <41AEDA75.1@archonet.com> Date: Thu, 02 Dec 2004 09:03:49 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Simon Moses Cc: pgsql-sql@postgresql.org Subject: Re: order by problem References: <20041201061449.42895.qmail@web14928.mail.yahoo.com> In-Reply-To: <20041201061449.42895.qmail@web14928.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.524 tagged_above=0 required=5 tests=AWL, DEAR_SOMETHING, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/26 X-Sequence-Number: 19646 Simon Moses wrote: > dear sir, > when i run a query with order by customer_name i am > getting the following result(ex.). > > AA > A B > AC > > i want it to be > > A B > AA > AB Sorting is down to your locale (the LC_xxx configuration settings). This is set when you initdb your database. It looks to me like you want "C" sorting, so dump your database, re-initdb with --locale=C and restore the dump. There's a whole chapter on localisation in the manuals. Make sure you are clear on the difference between encoding and locale. -- Richard Huxton Archonet Ltd