Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gm7vp-0006SM-VU for pgsql-docs@arkaria.postgresql.org; Wed, 23 Jan 2019 02:06:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gm7qK-0002Ft-8L for pgsql-docs@arkaria.postgresql.org; Wed, 23 Jan 2019 02:00:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gm7nB-0005KU-7y for pgsql-docs@lists.postgresql.org; Wed, 23 Jan 2019 01:57:25 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gm6p5-0005Zo-4c for pgsql-docs@lists.postgresql.org; Wed, 23 Jan 2019 00:55:23 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1gm6p1-0002rY-5d; Tue, 22 Jan 2019 19:55:15 -0500 Date: Tue, 22 Jan 2019 19:55:15 -0500 From: Bruce Momjian To: f2381430@mvrht.com, pgsql-docs@lists.postgresql.org Subject: Re: Undocumented behaviour of \s in SIMILAR TO expression Message-ID: <20190123005515.GC1493@momjian.us> References: <154470529073.5057.10757027183683688588@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <154470529073.5057.10757027183683688588@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 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 +