From 710d90da1fd8c1d028215ecaf7402062079e99e9 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Tue, 3 Apr 2018 19:46:45 +0300 Subject: Add prefix operator for TEXT type. The prefix operator along with SP-GiST indexes can be used as an alternative for LIKE 'word%' commands and it doesn't have a limitation of string/prefix length as B-Tree has. Bump catalog version Author: Ildus Kurbangaliev with some editorization by me Review by: Arthur Zakirov, Alexander Korotkov, and me Discussion: https://www.postgresql.org/message-id/flat/20180202180327.222b04b3@wp.localdomain --- doc/src/sgml/func.sgml | 21 +++++++++++++++++++++ doc/src/sgml/spgist.sgml | 1 + 2 files changed, 22 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 5abb1c46fbb..9a1efc14cf7 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -2274,6 +2274,21 @@ ph + + + + starts_with + + starts_with(string, prefix) + + bool + + Returns true if string starts with prefix. + + starts_with('alphabet', 'alph') + t + + @@ -4033,6 +4048,12 @@ cast(-44 as bit(12)) 111111010100 ILIKE, respectively. All of these operators are PostgreSQL-specific. + + + There is also the prefix operator ^@ and corresponding + starts_with function which covers cases when only + searching by beginning of the string is needed. + diff --git a/doc/src/sgml/spgist.sgml b/doc/src/sgml/spgist.sgml index e47f70be89b..06b75190522 100644 --- a/doc/src/sgml/spgist.sgml +++ b/doc/src/sgml/spgist.sgml @@ -161,6 +161,7 @@ ~<~ ~>=~ ~>~ + ^@ -- cgit v1.2.3