summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2018-04-03 19:46:45 +0300
committerTeodor Sigaev <teodor@sigaev.ru>2018-04-03 19:46:45 +0300
commit710d90da1fd8c1d028215ecaf7402062079e99e9 (patch)
tree6fb5d284edb7a9c37e3ae633c92779a65d1b97c6 /doc/src
parent4ab299981576ca0f3dbb879b5e2b704e743d87f3 (diff)
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml21
-rw-r--r--doc/src/sgml/spgist.sgml1
2 files changed, 22 insertions, 0 deletions
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
@@ -2277,6 +2277,21 @@
<row>
<entry>
<indexterm>
+ <primary>starts_with</primary>
+ </indexterm>
+ <literal><function>starts_with(<parameter>string</parameter>, <parameter>prefix</parameter>)</function></literal>
+ </entry>
+ <entry><type>bool</type></entry>
+ <entry>
+ Returns true if <parameter>string</parameter> starts with <parameter>prefix</parameter>.
+ </entry>
+ <entry><literal>starts_with('alphabet', 'alph')</literal></entry>
+ <entry><literal>t</literal></entry>
+ </row>
+
+ <row>
+ <entry>
+ <indexterm>
<primary>to_ascii</primary>
</indexterm>
<literal><function>to_ascii(<parameter>string</parameter> <type>text</type>
@@ -4033,6 +4048,12 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation>
ILIKE</function>, respectively. All of these operators are
<productname>PostgreSQL</productname>-specific.
</para>
+
+ <para>
+ There is also the prefix operator <literal>^@</literal> and corresponding
+ <function>starts_with</function> function which covers cases when only
+ searching by beginning of the string is needed.
+ </para>
</sect2>
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 @@
<literal>~&lt;~</literal>
<literal>~&gt;=~</literal>
<literal>~&gt;~</literal>
+ <literal>^@</literal>
</entry>
</row>
<row>