Re: 7.3 no longer using indexes for LIKE queries - Mailing list pgsql-general

From Jean-Luc Lachance
Subject Re: 7.3 no longer using indexes for LIKE queries
Date
Msg-id 3DEE6495.16E9C4EE@nsd.ca
Whole thread Raw
In response to Re: 7.3 no longer using indexes for LIKE queries  (Matthew Gabeler-Lee <mgabelerlee@zycos.com>)
List pgsql-general
C_COLLATE is what is involved with accents.

How would you sort:

CÔTE
CÔTES
COTÉ
COTÉS
COTE

You can't fold accented character into non accented because unique index
would barf on CÔTE if COTE is already in.

You still need to know if 'CÔTE' < 'COTÉ' or not when you do a sort.

Collating in french, for example, is not a byte to byte compare.

If you compare words based only on their binary representation, the sort
will be wrong
CRIME before CÔTE.


JLL


Matthew Gabeler-Lee wrote:

> 4) accent folding; I'm not entirely sure like is supposed to do this.  I'm
> going to pretend for the rest of this that the like operator shouldn't fold
> accented characters.
>
> [...]
>
> It seems to me that the most common place one wants to think about this is
> in full text searching and the like.  In this case, maybe I'm daft, but
> perhaps the thing to do is to create a functional index, where the function
> being indexed strips all the accents off characters.
>
> Does the SQL spec have anything to say on accent folding in comparisons?

pgsql-general by date:

Previous
From: Matthew Gabeler-Lee
Date:
Subject: Query breaking with unknown expression type (lost subquery from v iew?)
Next
From: Joel Burton
Date:
Subject: Re: Functions just dont want to work! [hard]