Addition to / Clarification in 9.7.1. LIKE

Started by GPTover 8 years ago4 messagesdocs
Jump to latest
#1GPT
gptmailinglists@gmail.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/functions-matching.html
Description:

Between the 1st and 2nd paragraphs please add a new one which make clear
(also to a newbie like myself) that the _only characters_ can be used in
pattern are (_) and (%).

Tia

#2Bruce Momjian
bruce@momjian.us
In reply to: GPT (#1)
Re: Addition to / Clarification in 9.7.1. LIKE

On Thu, Dec 14, 2017 at 09:33:39AM +0000, gptmailinglists@gmail.com wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/functions-matching.html
Description:

Between the 1st and 2nd paragraphs please add a new one which make clear
(also to a newbie like myself) that the _only characters_ can be used in
pattern are (_) and (%).

Uh, it is not totally clear what you are suggesting here. I think you
are talking about the LIKE command and its use of _ and %. What detail
should be added? Can you show an example?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +
#3GPT
gptmailinglists@gmail.com
In reply to: Bruce Momjian (#2)
Re: Addition to / Clarification in 9.7.1. LIKE

Between 1st (The LIKE expression...) and 2nd (If pattern does not...)
paragraphs, it could be added something like:

<begin>
Caution
Contrary to some other databases, in Postgresql only two characters
are used in LIKE patterns: underscore (_) and percent sign (%).
The use of any other character will lead to an error.
<end>

The error message also would be more clarified to inform user about
the use of not supported characters.

Show quoted text

On 1/25/18, Bruce Momjian <bruce@momjian.us> wrote:

On Thu, Dec 14, 2017 at 09:33:39AM +0000, gptmailinglists@gmail.com wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/functions-matching.html
Description:

Between the 1st and 2nd paragraphs please add a new one which make clear
(also to a newbie like myself) that the _only characters_ can be used in
pattern are (_) and (%).

Uh, it is not totally clear what you are suggesting here. I think you
are talking about the LIKE command and its use of _ and %. What detail
should be added? Can you show an example?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +
#4Bruce Momjian
bruce@momjian.us
In reply to: GPT (#3)
Re: Addition to / Clarification in 9.7.1. LIKE

On Fri, Jan 26, 2018 at 09:52:07AM +0100, GPT wrote:

Between 1st (The LIKE expression...) and 2nd (If pattern does not...)
paragraphs, it could be added something like:

<begin>
Caution
Contrary to some other databases, in Postgresql only two characters
are used in LIKE patterns: underscore (_) and percent sign (%).
The use of any other character will lead to an error.
<end>

The error message also would be more clarified to inform user about
the use of not supported characters.

Uh, I still don't understand what error you are talking about. Here are
some examples:

SELECT 'abc' LIKE 'a_c';
?column?
----------
t

SELECT 'abc' LIKE 'a%c';
?column?
----------
t

SELECT 'abc' LIKE 'a%*c';
?column?
----------
f

Can you show me an example?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +