pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedUndocumented behaviour of \s in SIMILAR TO expression
2+ messages / 2 participants
[nested] [flat]
* Undocumented behaviour of \s in SIMILAR TO expression
@ 2018-12-13 12:48 PG Doc comments form <noreply@postgresql.org>
2019-01-23 00:55 ` Re: Undocumented behaviour of \s in SIMILAR TO expression Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2018-12-13 12:48 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: f2381430@mvrht.com
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.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Undocumented behaviour of \s in SIMILAR TO expression
2018-12-13 12:48 Undocumented behaviour of \s in SIMILAR TO expression PG Doc comments form <noreply@postgresql.org>
@ 2019-01-23 00:55 ` Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Momjian @ 2019-01-23 00:55 UTC (permalink / raw)
To: f2381430@mvrht.com; pgsql-docs@lists.postgresql.org
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@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 +
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-01-23 00:55 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 12:48 Undocumented behaviour of \s in SIMILAR TO expression PG Doc comments form <noreply@postgresql.org>
2019-01-23 00:55 ` Bruce Momjian <bruce@momjian.us>
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