Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1FA4D1337C41 for ; Tue, 10 May 2011 14:53:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 12125-03-8 for ; Tue, 10 May 2011 17:53:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) by mail.postgresql.org (Postfix) with ESMTP id 3682C1337C05 for ; Tue, 10 May 2011 14:52:53 -0300 (ADT) Received: by pzk9 with SMTP id 9so2924481pzk.19 for ; Tue, 10 May 2011 10:52:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.32.167 with SMTP id k7mr9643489pbi.438.1305049503342; Tue, 10 May 2011 10:45:03 -0700 (PDT) Received: by 10.68.48.68 with HTTP; Tue, 10 May 2011 10:45:03 -0700 (PDT) X-Originating-IP: [66.215.95.51] In-Reply-To: <18244.1305046026@sss.pgh.pa.us> References: <216FFB77CBFAEE4B8EE4DF0A939FF1D14F85F1@mail-001.corp.automotive.com> <4DC84284.4000903@encs.concordia.ca> <216FFB77CBFAEE4B8EE4DF0A939FF1D14F85F7@mail-001.corp.automotive.com> <4DC845EC.1020806@encs.concordia.ca> <216FFB77CBFAEE4B8EE4DF0A939FF1D14F85F8@mail-001.corp.automotive.com> <4DC850CC.50409@encs.concordia.ca> <4547.1304976514@sss.pgh.pa.us> <216FFB77CBFAEE4B8EE4DF0A939FF1D14F85F9@mail-001.corp.automotive.com> <216FFB77CBFAEE4B8EE4DF0A939FF1D14F85FA@mail-001.corp.automotive.com> <216FFB77CBFAEE4B8EE4DF0A939FF1D14F85FB@mail-001.corp.automotive.com> <18244.1305046026@sss.pgh.pa.us> Date: Tue, 10 May 2011 10:45:03 -0700 Message-ID: Subject: Re: Sorting Issue From: Samuel Gendler To: Tom Lane Cc: "Ozer, Pam" , emilu@encs.concordia.ca, pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=bcaec51ddbe30fa01204a2ef84c9 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201105/69 X-Sequence-Number: 35353 --bcaec51ddbe30fa01204a2ef84c9 Content-Type: text/plain; charset=ISO-8859-1 On Tue, May 10, 2011 at 9:47 AM, Tom Lane wrote: > "Ozer, Pam" writes: > > Isn't this the English standard for collation? Or is this a non-c > > locale as mentioned below? Is there anyway around this? > > > LC_COLLATE = 'en_US.utf8' > > en_US is probably using somebody's idea of "dictionary order", which > I believe includes ignoring spaces in the first pass. You might be > happier using "C" collation. Unfortunately that requires re-initdb'ing > your database (as of existing PG releases). > ugh. So what's the initdb incantation necessary to sort the way I'd expect an alphabetic sort to happen? I'm literally just in the process of bringing up a new project, so it's a perfect opportunity for me to get this set up correctly to begin with. THe default on my system was definitely en_US.utf8. --sam --bcaec51ddbe30fa01204a2ef84c9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, May 10, 2011 at 9:47 AM, Tom Lan= e <tgl@sss.pgh.pa= .us> wrote:
"Ozer, Pam" <pozer@automotive.com> writes:
> Isn't this the English standard for collation? =A0Or is this a non= -c
> locale as mentioned below? =A0Is there anyway around this?

> =A0 =A0 =A0 =A0LC_COLLATE =3D 'en_US.utf8'

en_US is probably using somebody's idea of "dictionary order= ", which
I believe includes ignoring spaces in the first pass. =A0You might be
happier using "C" collation. =A0Unfortunately that requires re-in= itdb'ing
your database (as of existing PG releases).

=

ugh. So what's the initdb incantation necessary to = sort the way I'd expect an alphabetic sort to happen? =A0I'm litera= lly just in the process of bringing up a new project, so it's a perfect= opportunity for me to get this set up correctly to begin with. =A0THe defa= ult on my system was definitely en_US.utf8.

--sam


--bcaec51ddbe30fa01204a2ef84c9--