Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 98212476275 for ; Mon, 23 Sep 2002 10:11:14 -0400 (EDT) Received: from ec.se (bowser.ec.se [213.88.243.12]) by postgresql.org (Postfix) with ESMTP id B664A476003 for ; Mon, 23 Sep 2002 10:11:12 -0400 (EDT) Received: from tobbes [62.119.73.5] by ec.se [213.88.243.12] with SMTP (MDaemon.v3.5.6.R) for ; Mon, 23 Sep 2002 16:10:54 +0200 From: =?iso-8859-1?Q?Thorbj=F6rn_Eriksson?= To: Cc: Subject: Re: Stripping white-space in SELECT statments Date: Mon, 23 Sep 2002 16:28:41 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal In-Reply-To: <25711.1032445912@sss.pgh.pa.us> X-MDRemoteIP: 62.119.73.5 X-Return-Path: thorbjorn.eriksson@ec.se X-MDaemon-Deliver-To: pgsql-sql@postgresql.org Reply-To: thorbjorn.eriksson@ec.se X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/262 X-Sequence-Number: 9539 Thank's Tom Lane & Stephan Szabo for pointing out the problem to me. After some testing it turned out that the swedish locale, 'sv_SE', doesn't handle sorting spaces as expected, which probably made the SELECT fail. On the other hand, if I use the 'C' locale, the SELECT works but not the sort order of the swedish characters 'åäö'. Does anyone know a solution to this problem, or could give me a hint? > -----Ursprungligt meddelande----- > Från: Tom Lane [mailto:tgl@sss.pgh.pa.us] > Skickat: den 19 september 2002 16:32 > Till: thorbjorn.eriksson@ec.se > Kopia: pgsql-sql@postgresql.org > Ämne: Re: [SQL] Stripping white-space in SELECT statments > > > =?iso-8859-1?Q?Thorbj=F6rn_Eriksson?= writes: > > I've encountered a strange behavior in postgres 7.2.1 regarding how psql > > handles strings ending with space characters. > > Perhaps you are running in a non-C locale? A lot of locales have > sorting rules that are pretty weird about whitespace. > > > The reason that we don't use 'LIKE 201901 %' is that it don't use > > the index > > This suggests strongly that you are in a non-C locale. Your external > software seems to be emulating the standard LIKE-to-index optimization; > which as you are now discovering, does not work with non-C sorting > rules (so the system doesn't try to apply it). > > regards, tom lane > >