Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9C55F632D8C for ; Mon, 19 Jul 2010 02:23:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 44627-03 for ; Mon, 19 Jul 2010 05:23:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail2.topex.ro (mail2.topex.ro [82.137.49.134]) by mail.postgresql.org (Postfix) with ESMTP id E8E48632D49 for ; Mon, 19 Jul 2010 02:23:18 -0300 (ADT) Received: from mail2.topex.ro ([172.27.168.99]) by topex.ro with MailEnable ESMTP; Mon, 19 Jul 2010 08:23:16 +0300 X-ASG-Debug-ID: 1279516994-071727e90001-ysJW5H Received: from vr.localnet (89-38-174-194.volio.ro [89.38.174.194]) by mail2.topex.ro with ESMTP id 2Z3ezy8T23B8yiDu; Mon, 19 Jul 2010 08:23:15 +0300 (EEST) X-Barracuda-Envelope-From: robert.voinea@topex.ro X-Barracuda-AUTH-User: robert.voinea X-Barracuda-AUTH-User: robert.voinea X-ASG-Whitelist: Client From: Robert Voinea Organization: Topex To: pgsql-admin@postgresql.org X-ASG-Orig-Subj: Re: [ADMIN] Weird sorting order Subject: Re: Weird sorting order Date: Mon, 19 Jul 2010 08:23:13 +0300 User-Agent: KMail/1.13.2 (Linux/2.6.32-24-generic; KDE/4.4.2; i686; ; ) Cc: "Kevin Grittner" References: <201007161514.09960.robert.voinea@topex.ro> <4C40359E0200002500033711@gw.wicourts.gov> In-Reply-To: <4C40359E0200002500033711@gw.wicourts.gov> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201007190823.14092.robert.voinea@topex.ro> X-Barracuda-Connect: 89-38-174-194.volio.ro[89.38.174.194] X-Barracuda-Start-Time: 1279516994 X-Barracuda-URL: http://172.27.168.99:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at topex.ro X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.56 tagged_above=-10 required=5 tests=BAYES_50=0.8, RCVD_IN_SORBS_WEB=0.77, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: * X-Archive-Number: 201007/133 X-Sequence-Number: 35152 On Friday 16 July 2010 18:34:06 Kevin Grittner wrote: > Robert Voinea wrote: > > Why is it that when running the query: > > > > SELECT * FROM test ORDER BY val; > > > > I get the following result? > > > > id | val > > > > ----+------- > > > > 1 | 200 > > 2 | 201 > > 3 | 202 > > 4 | 203 > > 5 | 210 > > 6 | 211 > > 7 | 2##23 > > 8 | 2##24 > > 9 | 2##25 > > > > 10 | 2##33 > > 11 | ##26 > > 12 | 2ff > > 13 | ##31 > > 14 | ##32 > > 15 | ##34 > > > > (15 rows) > > > > Shouldn't value '2ff' be placed right after '211' but before > > '2##23'? > > That depends on your collation configuration. What do you get > from?: > > show lc_collate; > > In many collations, special characters such as '#' are ignored. => show lc_collate; lc_collate ------------- en_US.UTF-8 -- Robert Voinea Software Developer Phone: +40 21 408 38 00 / ext. 343 Fax: +40 21 408 38 08 Local time: GMT+2 http://www.topex.ro