Re: Stripping white-space in SELECT statments

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: thorbjorn(dot)eriksson(at)ec(dot)se
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Stripping white-space in SELECT statments
Date: 2002-09-19 14:31:52
Message-ID: 25711.1032445912@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

=?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 Stephan Szabo 2002-09-19 14:34:27 Re: Stripping white-space in SELECT statments
Previous Message Stephan Szabo 2002-09-19 14:28:01 Re: Index usage on date feild , differences in '>' and '>='