Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 1A317633957 for ; Wed, 13 May 2009 12:48:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 87218-08 for ; Wed, 13 May 2009 12:48:00 -0300 (ADT) 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 A659A633934 for ; Wed, 13 May 2009 12:48:00 -0300 (ADT) 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 n4DFluaE000369; Wed, 13 May 2009 11:47:56 -0400 (EDT) To: Maximilian Tyrtania , Alvaro Herrera , pgsql-sql@postgresql.org Subject: Re: Distinct oddity In-reply-to: <28943.1242226078@sss.pgh.pa.us> References: <28943.1242226078@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 13 May 2009 10:47:58 -0400" Date: Wed, 13 May 2009 11:47:56 -0400 Message-ID: <368.1242229676@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.138 tagged_above=0 required=5 tests=AWL=0.138 X-Spam-Level: X-Archive-Number: 200905/63 X-Sequence-Number: 32555 I wrote: > Maximilian Tyrtania writes: >> am 12.05.2009 19:23 Uhr schrieb Alvaro Herrera unter >> alvherre@commandprompt.com: >>> What platform are you using anyway? >> Mac OS 10.4.11 > I have some vague recollection that UTF8-using locales don't actually > work well on OSX ... check the archives ... OK, the thread (or one of the threads) I was remembering is here: http://archives.postgresql.org//pgsql-general/2005-11/msg00047.php I am too lazy to boot up 10.4 right now, but looking on a 10.5.6 machine indicates that Apple is still being pretty lame about this: $ ls -l /usr/share/locale/de_DE total 40 lrwxr-xr-x 1 root wheel 28 Feb 27 2008 LC_COLLATE -> ../la_LN.US-ASCII/LC_COLLATE lrwxr-xr-x 1 root wheel 17 Feb 27 2008 LC_CTYPE -> ../UTF-8/LC_CTYPE drwxr-xr-x 3 root wheel 102 Feb 27 2008 LC_MESSAGES lrwxr-xr-x 1 root wheel 30 Feb 27 2008 LC_MONETARY -> ../de_DE.ISO8859-1/LC_MONETARY lrwxr-xr-x 1 root wheel 29 Feb 27 2008 LC_NUMERIC -> ../de_DE.ISO8859-1/LC_NUMERIC -r--r--r-- 1 root wheel 370 Jan 2 2008 LC_TIME So it looks like they understand UTF-8 to the extent of supporting character classification fairly well, but sort order is "just ASCII". I'm not sure exactly how that might result in the observed odd behavior of DISTINCT, but I bet it's causing it somehow. You'd probably have better luck in the de_DE.ISO8859-1 or de_DE.ISO8859-15 locales. regards, tom lane