Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr7px-0007IA-HH for pgsql-admin@arkaria.postgresql.org; Wed, 19 Nov 2014 16:10:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xr7pw-00085D-Uf for pgsql-admin@arkaria.postgresql.org; Wed, 19 Nov 2014 16:10:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xr7pw-000854-8n for pgsql-admin@postgresql.org; Wed, 19 Nov 2014 16:10:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xr7ps-0001yM-S8 for pgsql-admin@postgresql.org; Wed, 19 Nov 2014 16:10:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sAJGAQQT027276; Wed, 19 Nov 2014 11:10:26 -0500 From: Tom Lane To: Silvio Brandani cc: Albe Laurenz , "pgsql-admin@postgresql.org" Subject: Re: order by query wrong result In-reply-to: <546CBDF1.2030007@tech.sdb.it> References: <546CA188.705@tech.sdb.it> <546CBDF1.2030007@tech.sdb.it> Comments: In-reply-to Silvio Brandani message dated "Wed, 19 Nov 2014 16:57:37 +0100" Date: Wed, 19 Nov 2014 11:10:26 -0500 Message-ID: <27275.1416413426@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Silvio Brandani writes: > Hi, > lc_collate > ------------- > en_US.UTF-8 en_US (and, in fact, most Linux locales other than C) uses "dictionary order", which ignores pretty much everything except letters in its first-pass comparison. You can check that it's not just Postgres being weird by feeding the same data through sort(1) after setting LC_COLLATE this way in its environment. You'll get the same results. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin