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 26428.1189871299@sss.pgh.pa.us
Whole thread Raw
In response to Re: 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?  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-general
hubert depesz lubaczewski <depesz@depesz.com> writes:
> On Sat, Sep 15, 2007 at 11:09:39AM -0400, Tom Lane wrote:
>> = is not one of the members of the text_pattern_ops operator class.

> ok, but is there any reason for this?

Well, at the time those opclasses were invented, the regular = operator
didn't necessarily yield the same result --- in some locales strcoll()
can return "equal" for not-bitwise-equal strings.

As of a couple years ago, the regular text = operator only yields true
for bitwise-equal strings, so we could perhaps drop ~=~ and use = in its
place.  But I'd be worried about breaking existing queries that expect
the strangely-named operator to be there.

The operator class structure only permits one equality operator per
opclass, so supporting both is not feasible.

            regards, tom lane

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: 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?