Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UWq6g-0006TA-0E for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Apr 2013 15:35:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UWq6e-00033U-So for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Apr 2013 15:35:08 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UWlpW-0008Hk-7w for pgsql-bugs@postgresql.org; Mon, 29 Apr 2013 11:01:10 +0000 Received: from beta.ksoft.com.ua ([217.20.163.66]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UWlpK-0000Ov-UP for pgsql-bugs@postgresql.org; Mon, 29 Apr 2013 11:01:09 +0000 Received: from [192.168.0.102] (unknown [159.224.105.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: whiplash@bss.org.ua) by beta.ksoft.com.ua (Postfix) with ESMTPSA id 739AE16C602D; Mon, 29 Apr 2013 14:00:56 +0300 (EEST) Message-ID: <517E52E8.3040008@bss.org.ua> Date: Mon, 29 Apr 2013 14:00:56 +0300 From: whiplash User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Daniele Varrazzo CC: Jov , pgsql-bugs Subject: Re: BUG #8118: Wrong sorting text References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Thank you, works fine. >>> Bug reference: 8118 >>> Logged by: whiplash >>> Email address:whiplash@bss.org.ua >>> PostgreSQL version: 9.2.2 >>> Operating system: Linux (Fedora 11, Fedora 16 and Ubuntu 12.04) >>> Description: >>> >>> I execute query (1): >>> >>> SELECT t.name >>> FROM >>> ( >>> SELECT 'AAA AAA' AS name >>> UNION ALL >>> SELECT 'AAA_AAA' >>> UNION ALL >>> SELECT 'BBB_AAA' >>> UNION ALL >>> SELECT 'BBB AAB' >>> ) t >>> ORDER BY t.name >>> >>> and I getting a result: >>> >>> AAA AAA >>> AAA_AAA >>> BBB_AAA >>> BBB AAB > It's a matter of collate. If you want ascii ordering specify collate "C". > > ... > ORDER BY t.name collate "C"; > name > --------- > AAA AAA > AAA_AAA > BBB AAB > BBB_AAA > (4 rows) > > -- Daniele > -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs