Re: Undocumented behaviour of \s in SIMILAR TO expression

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: f2381430(at)mvrht(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Undocumented behaviour of \s in SIMILAR TO expression
Date: 2019-01-23 00:55:15
Message-ID: 20190123005515.GC1493@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Thu, Dec 13, 2018 at 12:48:10PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/11/functions-matching.html
> Description:
>
> SELECT ' ' SIMILAR TO '[\s]';
> returns true
>
> SELECT ' ' SIMILAR TO '[\q]';
> generates an error: [2201B]: ERROR: invalid regular expression: invalid
> escape \ sequence
>
> \s is not mentioned in the SIMILAR TO section
> (https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP).
> If it’s officially supported (which would be useful for my current task), it
> should be documented. Otherwise the server should generate an error like for
> other invalid escapes.

Well in:

https://www.postgresql.org/docs/11/functions-matching.html

I see \s documented, but not \q:

Table 9.19. Regular Expression Class-shorthand Escapes
Escape Description
\d [[:digit:]]
\s [[:space:]]
\w [[:alnum:]_] (note underscore is included)
\D [^[:digit:]]
\S [^[:space:]]
\W [^[:alnum:]_] (note underscore is included)

Frankly, I can't even guess what you expect \q to do.

--
Bruce Momjian <bruce(at)momjian(dot)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 +

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tatsuo Ishii 2019-01-23 04:18:18 Re: Typo in URL
Previous Message Michael Paquier 2019-01-23 00:25:36 Re: `transaction_read_only` GUC undocumented