Op 16-08-2022 om 13:46 schreef Daniel Gustafsson:
On 16 Aug 2022, at 12:54, Erik Rijkers <e...@xs4all.nl> wrote:

Op 16-08-2022 om 12:36 schreef Daniel Gustafsson:
On 16 Aug 2022, at 12:17, PG Doc comments form <nore...@postgresql.org> wrote:
I have a question regarding the trigram algorithm and I can not find any
information about it in your documentation:
Maybe we should add something about this?

Yeah, it's a bit strange that none of the following strings yield any info on 
that page:  'case', 'sensitiv', 'upper', 'lower', and that there is no mention 
of the  ~  versus  ~*  difference.

Maybe worth to (already in pgtrgm.html) give the simple hint:
  ~  is case-sensitive
  ~* is case-insensitive

In any case a link to  functions-matching.html  seems indicated.

Yeah, I think there is room for improvements here.  Are you up for drafting a
patch for this?


How is this?

(bluntly stating 'similarity comparisons are case-insensitive' - although I'm not really sure..)


Erik

--
Daniel Gustafsson               https://vmware.com/
--- ./doc/src/sgml/pgtrgm.sgml.orig	2022-08-16 14:50:08.586555358 +0200
+++ ./doc/src/sgml/pgtrgm.sgml	2022-08-16 14:56:39.358617804 +0200
@@ -416,6 +416,8 @@
    the above-described similarity operators, and additionally support
    trigram-based index searches for <literal>LIKE</literal>, <literal>ILIKE</literal>,
    <literal>~</literal>, <literal>~*</literal> and <literal>=</literal> queries.
+   The similarity comparisons are case-insensitive, but these queries can be
+   case-sensitive (see <xref linkend="functions-matching"/>).
    Inequality operators are not supported.
    Note that those indexes may not be as efficient as regular B-tree indexes
    for equality operator.
@@ -534,7 +536,8 @@
   <para>
    Beginning in <productname>PostgreSQL</productname> 9.3, these index types also support
    index searches for regular-expression matches
-   (<literal>~</literal> and <literal>~*</literal> operators), for example
+   (<literal>~</literal> and <literal>~*</literal> operators, resp. case-sensitive and
+   case-insensitive), for example
 <programlisting>
 SELECT * FROM test_trgm WHERE t ~ '(foo|bar)';
 </programlisting>

Reply via email to