Re: Stripping white-space in SELECT statments - Mailing list pgsql-sql

From Tom Lane
Subject Re: Stripping white-space in SELECT statments
Date
Msg-id 25711.1032445912@sss.pgh.pa.us
Whole thread Raw
In response to Stripping white-space in SELECT statments  (Thorbjörn Eriksson <thorbjorn.eriksson@ec.se>)
Responses Re: Stripping white-space in SELECT statments  (Thorbjörn Eriksson <thorbjorn.eriksson@ec.se>)
List pgsql-sql
Thorbjörn Eriksson <thorbjorn.eriksson@ec.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


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Index usage on date feild , differences in '>' and '>='
Next
From: Stephan Szabo
Date:
Subject: Re: Stripping white-space in SELECT statments