Re: Prefix operator for text and spgist support

Emre Hasegeli <emre@hasegeli.com>

From: Emre Hasegeli <emre@hasegeli.com>
To: Teodor Sigaev <teodor@sigaev.ru>
Cc: Ildus Kurbangaliev <i.kurbangaliev@postgrespro.ru>, Alexander Korotkov <a.korotkov@postgrespro.ru>, Arthur Zakirov <a.zakirov@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-04-16T10:45:23Z
Lists: pgsql-hackers
> Thank you, pushed with some editorization and renaming text_startswith to
> starts_with

I am sorry for not noticing this before, but what is the point of this
operator?  It seems to me we are only making the prefix searching
business, which is already complicated, more complicated.

Also, the new operator is not documented on SQL String Functions and
Operators table.  It is not supported by btree text_pattern_ops or
btree indexes with COLLATE "C".  It is not defined for "citext", so
people would get wrong results.  It doesn't use pg_trgm indexes
whereas LIKE can.


Commits

  1. Add prefix operator for TEXT type.