Re: BUG #6232: hstore operator ? no longer uses indexes - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6232: hstore operator ? no longer uses indexes
Date
Msg-id 13745.1317264175@sss.pgh.pa.us
Whole thread Raw
In response to BUG #6232: hstore operator ? no longer uses indexes  ("Pierre Ducroquet" <p.psql@pinaraf.info>)
Responses Re: BUG #6232: hstore operator ? no longer uses indexes  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
"Pierre Ducroquet" <p.psql@pinaraf.info> writes:
> [ the "hstore ? text" operator no longer matches an hstore GIST index ]

Hmm ... this doesn't seem to be specific to either hstore or GIST; it's
a collation problem.  The index is marked as having no collation, which
is reasonable since hstore is a collation-less type.  However, the ?
OpExpr gets marked as having "default" collation because it has one
collatable input, namely the text constant.  And then,
match_clause_to_indexcol decides the clause doesn't match the index.

Not sure what to do about this.  Is it okay to suppose that collation
can be ignored when matching to a collation-less index?  If not, what's
the correct rule?  I don't like the idea of concluding that hstore has
to be forcibly assigned a collation just because it has some operators
that accept text ...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: BUG #6232: hstore operator ? no longer uses indexes
Next
From: Peter Eisentraut
Date:
Subject: Re: BUG #6232: hstore operator ? no longer uses indexes