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 1fqG0J-0001ZA-VQ for pgsql-general@arkaria.postgresql.org; Thu, 16 Aug 2018 10:59:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fqG0H-0004Dy-On for pgsql-general@arkaria.postgresql.org; Thu, 16 Aug 2018 10:59:45 +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 1fqG0G-0004Dq-Ip for pgsql-general@lists.postgresql.org; Thu, 16 Aug 2018 10:59:45 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqG0C-0001bQ-RW for pgsql-general@postgresql.org; Thu, 16 Aug 2018 10:59:43 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 27B6134C for ; Thu, 16 Aug 2018 06:59:39 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute7.internal (MEProxy); Thu, 16 Aug 2018 06:59:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hintbits.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=NIosNYsM7CJ8kunO/5NCsHHC1OgSD071/x1TFceV940=; b=kxPec ZLEcSzRafEXp/Ekg/i0rp2XH5K1PCabSK4yVcltD6wD2cJxKpnyLrYVMm2p7H743 Qx+aKr+BvRZiANISbRONHt99mtihYiWJmwp4n0quRAtaIZlH+af1lhJ4wuzsFDJP plBWkBTePpwZcWCUKJJ1uUvUem9MPtKJGPnxMw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=NIosNYsM7CJ8kunO/5NCsHHC1OgSD 071/x1TFceV940=; b=Ee7xUAfeXtjk5o48akPGbpS34B8b49+/HohFLdJHsvzvx NO8AROrA3BGKc5SFLH8zN6Me5ZKc+tg+Y0coMIo7GQ/z5vsMZn73AjycVKzkKxfA p4BvG9uPSf0q4PPLCKqwqjdvQtFAJjwF6oT/cpJObk05pz6EVN3b6bZBOgOenvPj sFwNzbP6kV7nMoccimzwtzKQqQq7h+JXKcWftkMQGlixDbWn12tn/vfwch7n9GoI j3wSYFUvmLEFJXskuxjC5MbrnTbKdssg2Hf3g9CgaQoWXCbIN6FIoTng8H8NetkY dSQYXrHXWhi/g8k7k9qTbEqD9Tpg6t5aK9hvKP1tQ== X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 6610C9421A; Thu, 16 Aug 2018 06:59:38 -0400 (EDT) Message-Id: <1534417178.2357012.1476047168.78425024@webmail.messagingengine.com> From: Alex Kliukin To: pgsql-general@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-7b72137a Subject: regex match and special characters Date: Thu, 16 Aug 2018 12:59:38 +0200 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, 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 actu= ally U+2006 SIX-PER-EM SPACE (http://www.fileformat.info/info/unicode/char/= 2006/index.htm) test=3D# select 'abcd=E2=80=86' ~ 'abcd\s'; ?column? ---------- t (1 row) test=3D# select version(); version ---------------------------------------------------------------------------= ---------------------- PostgreSQL 12devel on x86_64-pc-linux-gnu, compiled by gcc (Gentoo 6.4.0-r= 1 p1.3) 6.4.0, 64-bit (1 row) On another server (running on the same system on a different port) postgres=3D# select version(); version ---------------------------------------------------------------------------= -------------------- PostgreSQL 9.6.9 on x86_64-pc-linux-gnu, compiled by gcc (Gentoo 6.4.0-r1 = p1.3) 6.4.0, 64-bit (1 row) postgres=3D# select 'abcd=E2=80=86' ~ 'abcd\s'; ?column? ---------- f (1 row) For both clusters, the client encoding is UTF8, the database encoding and c= ollation is UTF8 and en_US.utf8 respectively, and the lc_ctype is en_US.utf= 8. I am accessing the databases running locally by ssh-ing first to the hos= t.=20 I observed similar issues with other Linux-based servers running Ubuntu, in= all cases the regex resulted in true on PostgreSQL 10+ and false on earlie= r versions (down to 9.3). The query comes from a table check that suddenly = stopped accepting rows valid in the older version during the migration. Mak= ing it select 'abcd=E2=80=86' ~ E'abcd\\s' doesn't modify the outcome, un= surprisingly. Is it reproducible for others here as well? Given that it is, Is there a wa= y to make both versions behave the same? Cheers, Alex