From: Tom Lane <tgl@sss.pgh.pa.us>
To: devops@key2asset.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18870: weird behavior with regexp_replace
Date: Thu, 27 Mar 2025 17:23:58 -0400
Message-ID: <2153095.1743110638@sss.pgh.pa.us> (raw)
In-Reply-To: <18870-70cd953a0c92c20e@postgresql.org>
References: <18870-70cd953a0c92c20e@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> select regexp_replace(LOWER('Örebro'), '\W', '_', 'g') in postgres 15 the
> result is örebro which is correct since ö should fit in the \w for a
> regex.
> select regexp_replace(LOWER('Örebro'), '\W', '_', 'g') --> since postgres 17
> the result is _rebro which is incorrect since \w should also contain
> characters like ö, ä, ë.
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, devops@key2asset.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18870: weird behavior with regexp_replace
In-Reply-To: <2153095.1743110638@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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