X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 40993D1B4EF for ; Wed, 17 Sep 2003 10:44:51 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 78012-09 for ; Wed, 17 Sep 2003 07:44:22 -0300 (ADT) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by svr1.postgresql.org (Postfix) with ESMTP id A1B6AD1B525 for ; Wed, 17 Sep 2003 07:44:03 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 3.35 #1) id 19zZn3-000Ew6-0V; Wed, 17 Sep 2003 11:44:06 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 9C5AF17919; Wed, 17 Sep 2003 11:44:04 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id E00101649D; Wed, 17 Sep 2003 11:44:03 +0100 (BST) From: Richard Huxton To: Kristian =?iso-8859-1?q?J=F6rg?= , pgsql-sql@postgresql.org Subject: Re: Sort order with spaces? Date: Wed, 17 Sep 2003 11:44:02 +0100 User-Agent: KMail/1.5 References: <3F682DB3.6080905@devo.se> In-Reply-To: <3F682DB3.6080905@devo.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200309171144.02871.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/152 X-Sequence-Number: 15130 On Wednesday 17 September 2003 10:47, Kristian J=F6rg wrote: > Hello! > > I am having troubles with sort order in Postgres. It seems that space is > not handled at all? > For instance the following rows are sorted in MS SQL Server as: > > LUNDGREN > M L R > MACDOWELL > MUSCLE > > But in Postgres I get this order: > > LUNDGREN > MACDOWELL > M L R > MUSCLE Sort order depends upon your locale settings (specifically LC_COLLATE), whi= ch=20 will have been set when you ran "initdb". Basically, sort orders for C ,=20 en_GB and fr will all be different. I'm guessing you expect "C" style=20 sorting. Check the end of your postgresql.conf file to see what settings you current= ly=20 have. See the manuals (Localization section) and list archives for plenty of=20 details. --=20 Richard Huxton Archonet Ltd