On 3/18/07, Martijn van Oosterhout <kleptog@svana.org> wrote:
> Er, it's link between LIKE and the ~=~ that's hard coded
Yes.
> So I think it's easier that you think: just build the operator class
> and make sure you use the right operator so the planner uses it. ILIKE
> already maps to an operator...
Yeah I know. The fact is that you can't use an index for any pattern
and it depends on the database encoding too. The code in the planner
checks that the pattern and the database encoding makes the index
usable and rewrites the LIKE clause (and the ILIKE clause if the
pattern begins with a non alpha character) so that it can use the
index.
So I'm pretty sure I have to change this behaviour in the planner or
did I miss something?
--
Guillaume