Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7C3841337B8B for ; Sun, 6 Feb 2011 12:06:22 -0400 (AST) 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 65187-08 for ; Sun, 6 Feb 2011 16:06:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id D83201337B84 for ; Sun, 6 Feb 2011 12:06:14 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p16G6AFD006871; Sun, 6 Feb 2011 11:06:11 -0500 (EST) To: Adam PAPAI cc: pgsql-bugs@postgresql.org Subject: Re: sort order (ORDER BY) hu_HU.UTF-8 locale with UTF-8 encoding is not working correctly on FreeBSD In-reply-to: <4D4E76BD.5060706@bsdsupportservice.hu> References: <4D4E76BD.5060706@bsdsupportservice.hu> Comments: In-reply-to Adam PAPAI message dated "Sun, 06 Feb 2011 11:23:57 +0100" Date: Sun, 06 Feb 2011 11:06:10 -0500 Message-ID: <6870.1297008370@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/64 X-Sequence-Number: 29336 Adam PAPAI writes: > [ hu_HU.UTF-8 locale doesn't sort as expected on ] > FreeBSD titanium 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 > UTC 2010 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 Do you get the expected sort ordering from the "sort" command either? I'm betting not. This is not something Postgres controls -- we just rely on the results of strcoll(). I don't know the state of affairs on FreeBSD for sure, but I do know that the UTF-8 locales are fairly broken on Mac OS X, which is a BSD derived platform too. It looks like nobody in BSD-land has bothered to put in the work to make multibyte characters sort properly. You might have better luck with hu_HU using a suitable LATINn character set instead of UTF8. If that still doesn't do what you want, you might have no choice but to move off BSD :-( regards, tom lane