Re: Stripping white-space in SELECT statments

From: Thorbjörn Eriksson <thorbjorn(dot)eriksson(at)ec(dot)se>
To: <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Stripping white-space in SELECT statments
Date: 2002-09-23 14:28:41
Message-ID: MFEPJLNKECPAPFDGGEIMMEOJCBAA.thorbjorn.eriksson@ec.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)sss(dot)pgh(dot)pa(dot)us]
> Skickat: den 19 september 2002 16:32
> Till: thorbjorn(dot)eriksson(at)ec(dot)se
> Kopia: pgsql-sql(at)postgresql(dot)org
> Ämne: Re: [SQL] Stripping white-space in SELECT statments
>
>
> =?iso-8859-1?Q?Thorbj=F6rn_Eriksson?= <thorbjorn(dot)eriksson(at)ec(dot)se> 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
>
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Aaron Held 2002-09-23 14:31:18 Re: [SQL] Monitoring a Query
Previous Message Tom Lane 2002-09-23 14:26:46 Re: Stripping white-space in SELECT statments