Re: text_pattern_ops index *not* used in field = value condition? - Mailing list pgsql-general

From Tom Lane
Subject Re: text_pattern_ops index *not* used in field = value condition?
Date
Msg-id 26023.1189868979@sss.pgh.pa.us
Whole thread Raw
In response to text_pattern_ops index *not* used in field = value condition?  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: text_pattern_ops index *not* used in field = value condition?
List pgsql-general
hubert depesz lubaczewski <depesz@depesz.com> writes:
> index is created using text_pattern_ops so i will be able to use it in 'where word like '...%''
> but, it appears it is not usable with = operator:

= is not one of the members of the text_pattern_ops operator class.

regression=# select amopopr::regoperator from pg_amop where amopclaid in (select oid from pg_opclass where opcname =
'text_pattern_ops');
     amopopr
-----------------
 ~<~(text,text)
 ~<=~(text,text)
 ~=~(text,text)
 ~>=~(text,text)
 ~>~(text,text)
 ~=~(text,text)
(6 rows)

            regards, tom lane

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: text_pattern_ops index *not* used in field = value condition?
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: text_pattern_ops index *not* used in field = value condition?