Re: Wrong Results from SP-GiST with Collations

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Emre Hasegeli <emre@hasegeli.com>, Teodor Sigaev <teodor@sigaev.ru>, PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Date: 2018-04-16T19:58:52Z
Lists: pgsql-bugs
On Mon, Apr 16, 2018 at 12:55 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I'm not following --- varstr_cmp has no way to know that we only
> care about equality vs inequality.  Yes, it might give back an
> answer quickly when the strings are equal, but when they aren't,
> it has to decide which is greater.  In this case we don't care,
> so long as the search operator is "=".

That was the subtlety I was missing. I didn't understand what you
meant, but thought that the fast-path might be relevant. Clearly not.

-- 
Peter Geoghegan


Commits

  1. Fix broken collation-aware searches in SP-GiST text opclass.

  2. Add prefix operator for TEXT type.