From: Erik Rijkers <er@xs4all.nl>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: marcmaiwald@googlemail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Lower or Upper case for F.33. pg_trgm
Date: Tue, 16 Aug 2022 15:03:05 +0200
Message-ID: <4be605ae-7fbb-c47c-9c7f-f8965ff0ea9e@xs4all.nl> (raw)
In-Reply-To: <5B31E9AC-9F6B-47BB-85DB-188507CF6297@yesql.se>
References: <166064504415.652.12724576876807446945@wrigleys.postgresql.org>
<65FB8525-EB15-4A22-B204-51385A088D64@yesql.se>
<3856dba5-81c8-8221-90e6-5307679f9be7@xs4all.nl>
<5B31E9AC-9F6B-47BB-85DB-188507CF6297@yesql.se>
Op 16-08-2022 om 13:46 schreef Daniel Gustafsson:
>> On 16 Aug 2022, at 12:54, Erik Rijkers <er@xs4all.nl> wrote:
>>
>> Op 16-08-2022 om 12:36 schreef Daniel Gustafsson:
>>>> On 16 Aug 2022, at 12:17, PG Doc comments form <noreply@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/
>
Attachments:
[text/x-patch] pgtrgm.sgml.20220816.diff (1.1K, ../4be605ae-7fbb-c47c-9c7f-f8965ff0ea9e@xs4all.nl/2-pgtrgm.sgml.20220816.diff)
download | inline diff:--- ./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 instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: er@xs4all.nl, daniel@yesql.se, marcmaiwald@googlemail.com, pgsql-docs@lists.postgresql.org
Subject: Re: Lower or Upper case for F.33. pg_trgm
In-Reply-To: <4be605ae-7fbb-c47c-9c7f-f8965ff0ea9e@xs4all.nl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox