Re: Redefining LIKE operator

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Redefining LIKE operator
Дата
Msg-id 21385.1047656670@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Redefining LIKE operator  (Pablo Sajnín <psajnin@bejerman.com.ar>)
Список pgsql-general
Pablo Sajn�n <psajnin@bejerman.com.ar> writes:
> I need the LIKE operator to be case insensitive.
> What I did is to redefine the ~~ so it behaves as the ~~* operator:

> DROP OPERATOR ~~ (name, text);
> CREATE OPERATOR ~~ ( leftarg=name, rightarg=text, procedure=nameiclike,
> negator='!~~');

> The operator is created, but when I execute a query, LIKE is still being
> case-sensitive.

There are five operators named '~~'; are you sure your LIKE is invoking
the "name" variant?  I'd bet against that, if your tables are declared
with MSSQL-compatible datatypes.

I'd suggest renaming the standard operators out of the way, rather than
dropping them altogether.  Also your CREATE is missing the selectivity
estimators.  But in general this should work if you do it right.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: Is a limitation for the number of large objects that can be stored in a PostgreSQL database?
Следующее
От: merlyn@stonehenge.com (Randal L. Schwartz)
Дата:
Сообщение: Re: constant scalar subselect no longer equivalent to constant?