Re: Non-C locale and LIKE - Mailing list pgsql-hackers

From John Hansen
Subject Re: Non-C locale and LIKE
Date
Msg-id 5066E5A966339E42AA04BA10BA706AE56216@rodrick.geeknet.com.au
Whole thread Raw
In response to Non-C locale and LIKE  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
> However, I am wondering if we should create a character
> lookup during initdb that has the characters ordered so we can do:
>
>     col LIKE 'ha%' AND col >= "ha" and col <= "hb"
>
> Could we do this easily for single-character encodings?  We
> could have:
>
>     A    1
>     B    2
>     C    3
>
> and a non-C locale could be:
>
>     A    1
>     A`    2
>     B    3
>
> We can't handle multi-byte encodings because the number of
> combinations is too large or not known.
>
> Also, we mention you should use the "C" locale to use normal
> indexes for LIKE but isn't it more correct to say the
> encoding has to be SQL_ASCII?

Would it not be better to take this as an opportunity to integrate ICU ?

That would work with both single and multibyte encodings.

... John


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Non-C locale and LIKE
Next
From: Tatsuo Ishii
Date:
Subject: Re: Non-C locale and LIKE