Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id A94C7B5D803 for ; Tue, 14 Jun 2011 03:44:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 27682-03 for ; Tue, 14 Jun 2011 06:44:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id 0A0BDB5D800 for ; Tue, 14 Jun 2011 03:44:36 -0300 (ADT) Received: by fxm17 with SMTP id 17so3313404fxm.19 for ; Mon, 13 Jun 2011 23:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=EBeSZDbrabN6QBgR4rWCPurDQUCXhmCR4FO0uMVaelQ=; b=Ne/MA3fkOAC+lv5H0ImqcidmhjhFEh8Ktvh0/0UpV+fHoN5NhtpFaR4lkr+lLArToQ ECosoI3hpjHMMhy2h1JyQS3hD/srnPp6dDXJfwKef5KYyKmBSFt/k2pWK0lNGEOr6Yfs AEOevRUeTreAVtuciNn7d/n80ItK6efqm6yqM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=pcoNWN6izNVN2dvGUFGrryO5/v4LNCCOBBoTtvDl70frTGt/erIECeYiUo1f0SsAjj cMqRQAs4/kaFw7QSC9MjHkP3WmB0Y9pOu3d/1l1KGfskqUEnsCLup2Wp1+qARai4Trc/ SD5PDJ1tnEU1HlFzIjJiFFnYeSzIY/iyCWyPc= MIME-Version: 1.0 Received: by 10.223.16.131 with SMTP id o3mr4972565faa.53.1308033875948; Mon, 13 Jun 2011 23:44:35 -0700 (PDT) Received: by 10.223.83.15 with HTTP; Mon, 13 Jun 2011 23:44:35 -0700 (PDT) In-Reply-To: <201106132152.p5DLq6Hq046860@wwwmaster.postgresql.org> References: <201106132152.p5DLq6Hq046860@wwwmaster.postgresql.org> Date: Tue, 14 Jun 2011 15:44:35 +0900 Message-ID: Subject: Re: BUG #6056: sorting issues From: Itagaki Takahiro To: Mike Hepworth Cc: pgsql-bugs@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.031 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1.929, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201106/102 X-Sequence-Number: 30481 On Tue, Jun 14, 2011 at 06:52, Mike Hepworth wrote: > Bug reference: =C2=A0 =C2=A0 =C2=A06056 > Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Mike Hepworth > Email address: =C2=A0 =C2=A0 =C2=A0michael.w.hepworth@gmail.com > PostgreSQL version: 8.4 > Operating system: =C2=A0 Ubuntu 10.4 > Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0sorting issues > Details: > > Have database that is utf-8 encoding so that I can support both english, > french, and spanish. =C2=A0Having problems with the ordering of data. > > I execute the following sql statment: > > select * from (values('HALL, ANDY'),('HALLBERG, FRANK'),('HALLDEN, > DOUGLAS'),('HALL, DOUGLAS') ) x ORDER BY 1; > > and get the following results > > HALL, ANDY > HALLBERG, FRANK > HALLDEN, DOUGLAS > HALL, DOUGLAS What locale did you use? Sort order depends on not only encoding but also collation. Please check "SHOW lc_collate". Your locale seems to just ignore symbol characters. I have an expected result at least in C locale. --=20 Itagaki Takahiro