Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1txuhw-00GPxQ-UY for pgsql-bugs@arkaria.postgresql.org; Thu, 27 Mar 2025 21:24:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1txuhu-00DzS7-Qb for pgsql-bugs@arkaria.postgresql.org; Thu, 27 Mar 2025 21:24:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1txuhu-00DzRz-Ia for pgsql-bugs@lists.postgresql.org; Thu, 27 Mar 2025 21:24:10 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1txuhs-001UtJ-1u for pgsql-bugs@lists.postgresql.org; Thu, 27 Mar 2025 21:24:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 52RLNwku2153096; Thu, 27 Mar 2025 17:24:00 -0400 From: Tom Lane To: devops@key2asset.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18870: weird behavior with regexp_replace In-reply-to: <18870-70cd953a0c92c20e@postgresql.org> References: <18870-70cd953a0c92c20e@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 27 Mar 2025 13:43:50 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2153094.1743110638.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 27 Mar 2025 17:23:58 -0400 Message-ID: <2153095.1743110638@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > select regexp_replace(LOWER('=C3=96rebro'), '\W', '_', 'g') in postgres= 15 the > result is =C3=B6rebro which is correct since =C3=B6 should fit in the \w= for a > regex. > select regexp_replace(LOWER('=C3=96rebro'), '\W', '_', 'g') --> since po= stgres 17 > the result is _rebro which is incorrect since \w should also contain > characters like =C3=B6, =C3=A4, =C3=AB. This most likely indicates that you've got a different database collation selected in the v17 installation. Postgres defers to the LC_CTYPE setting (or, in some configurations, the ICU collation) to decide what is a letter. See https://www.postgresql.org/docs/current/charset.html psql's "\l" command will give a quick overview of what collations you have selected. regards, tom lane