Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fr2Ac-0000oO-M9 for pgsql-general@arkaria.postgresql.org; Sat, 18 Aug 2018 14:25:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fr2Ab-00067A-5X for pgsql-general@arkaria.postgresql.org; Sat, 18 Aug 2018 14:25:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fr2Aa-00066v-OB for pgsql-general@lists.postgresql.org; Sat, 18 Aug 2018 14:25:36 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fr2AX-00061j-Fz for pgsql-general@postgresql.org; Sat, 18 Aug 2018 14:25:35 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 5DC9F21949; Sat, 18 Aug 2018 10:25:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 18 Aug 2018 10:25:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hintbits.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=83kl8MK1Z+v6fdS5UX9hJGbaD+E6odgkLEzxSmEYkao=; b=fISQL KG2k/fMZQEkDyyoXoBJc6pqvGP6cMsT7W+kxu9JIoqjLPyslRAJmE8KQLWvqwLBB gmGI3k6ZHMzqOpaVmR9geqzQFpkvEbIUk/Vau8Z+o+y8YCKwzV9iXq8it4qJGzG8 fqz8el0v4cETrUkYjMZNjXqCvlhh1eytHR9qtw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=83kl8MK1Z+v6fdS5UX9hJGbaD+E6o dgkLEzxSmEYkao=; b=uERItb2AhKFX15o/6V6X2fJGV+wSTzdEnFDNEhb24unA2 MRtirrJOYYNlSvNWa3kjGwXh7P3uT/KElt5QkWnMiD1cbmwmbT/OMdrSRIb9Sgpu pdqTZ+Z5iYVe0YMk7D5ZT+hK/Juuu4Es4IgARWJ5Tz/Tm/Amwcjfstu2qS25uPHA sNtpZ6pu+uAPBvrNMfnkxEsCQ3LPabmXRznZ9y8/ZkEHQArllJTgkuCEZMND/hJI 9TUFjQA/L3ApSa6bdvJAMUMcSDa2h9kFcTeKyF9Z2DfEuQkKMe6jWSDXzLyMEEio KmlO06YyWrftYOcpSKuX9afhkcnXkvDrFHCPUdggQ== X-ME-Proxy: X-ME-Sender: Received: from [192.168.88.116] (unknown [31.135.125.72]) by mail.messagingengine.com (Postfix) with ESMTPA id 30B3610255; Sat, 18 Aug 2018 10:25:31 -0400 (EDT) From: Oleksii Kliukin Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_BFDE2BD3-0B52-4677-B7D1-B75C742529AF" Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: regex match and special characters Date: Sat, 18 Aug 2018 17:24:58 +0300 In-Reply-To: <9646.1534427859@sss.pgh.pa.us> Cc: pgsql-general@postgresql.org To: Tom Lane References: <1534417178.2357012.1476047168.78425024@webmail.messagingengine.com> <9646.1534427859@sss.pgh.pa.us> X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_BFDE2BD3-0B52-4677-B7D1-B75C742529AF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 16. Aug 2018, at 16:57, Tom Lane wrote: >=20 > Alex Kliukin writes: >> Here is a simple SQL statement that gives different results on = PostgreSQL 9.6 and PostgreSQL 10+. The space character at the end of the = string is actually U+2006 SIX-PER-EM SPACE = (http://www.fileformat.info/info/unicode/char/2006/index.htm) >=20 > I think the reason for the discrepancy is that in v10 we fixed the = regex > locale support so that it could properly classify code points above = U+7FF, > cf >=20 > = https://git.postgresql.org/gitweb/?p=3Dpostgresql.git&a=3Dcommitdiff&h=3Dc= 54159d44ceaba26ceda9fea1804f0de122a8f30 = This nails down the cause, thanks a lot for the link! Apparently I = missed it from PostgreSQL 10 release notes, where it is present in the = =E2=80=9CQueries=E2=80=9D section, although AFAIK it deserved an entry = in the "migration to version 10=E2=80=9D, as it may potentially make = dump/restore from previous versions to version 10 error out if there are = table constraints that use regex classes over the Unicode text fields = with code points above U+7FF. >=20 > So 10 is giving the right answer (i.e. that \s matches U+2006). > 9.x is not Agreed. Cheers, Alex= --Apple-Mail=_BFDE2BD3-0B52-4677-B7D1-B75C742529AF Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 16. Aug 2018, at 16:57, Tom Lane <tgl@sss.pgh.pa.us> = wrote:

Alex Kliukin <alexk@hintbits.com> writes:
Here is a simple SQL statement that gives = different results on PostgreSQL 9.6 and PostgreSQL 10+. The space = character at the end of the string is actually U+2006 SIX-PER-EM SPACE = (http://www.fileformat.info/info/unicode/char/2006/index.htm= )

I think the reason for the = discrepancy is that in v10 we fixed the regex
locale = support so that it could properly classify code points above U+7FF,
cf

https://git.postgresql.org/gitweb/?p=3Dpostgresql.git&a=3Dc= ommitdiff&h=3Dc54159d44ceaba26ceda9fea1804f0de122a8f30

This nails down the cause, thanks a lot for = the link! Apparently I missed it from PostgreSQL 10 release notes, where = it is present in the =E2=80=9CQueries=E2=80=9D section, although AFAIK = it deserved an entry in the "migration to version 10=E2=80=9D, as it may = potentially make dump/restore from previous versions to version 10 error = out if there are table constraints that use regex classes over the = Unicode text fields with code points above U+7FF.

So 10 is giving the right = answer (i.e. that \s matches U+2006).
9.x is = not

Agreed.

Cheers,
Alex
= --Apple-Mail=_BFDE2BD3-0B52-4677-B7D1-B75C742529AF--