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 1uIWYz-006UGW-EA for pgsql-hackers@arkaria.postgresql.org; Fri, 23 May 2025 17:52:09 +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 1uIWYy-004TvW-9d for pgsql-hackers@arkaria.postgresql.org; Fri, 23 May 2025 17:52:07 +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 1uIWYx-004Tsh-Vx for pgsql-hackers@lists.postgresql.org; Fri, 23 May 2025 17:52:07 +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 1uIWYv-000YLb-1l for pgsql-hackers@lists.postgresql.org; Fri, 23 May 2025 17:52:06 +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 54NHq1VR2568905; Fri, 23 May 2025 13:52:01 -0400 From: Tom Lane To: Florents Tselai cc: Peter Eisentraut , Robert Haas , Alexander Korotkov , pgsql-hackers , Andrew Dunstan Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part In-reply-to: <01DC1C38-0692-461B-AA63-5394330356BE@gmail.com> References: <145894.1727298237@sss.pgh.pa.us> <7e9debe6-4e96-4b0d-a801-b531e962ef43@eisentraut.org> <01DC1C38-0692-461B-AA63-5394330356BE@gmail.com> Comments: In-reply-to Florents Tselai message dated "Fri, 23 May 2025 20:06:25 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2568903.1748022721.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 23 May 2025 13:52:01 -0400 Message-ID: <2568904.1748022721@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Florents Tselai writes: > On 22 May 2025, at 11:56=E2=80=AFPM, Peter Eisentraut wrote: >> I don't understand how this discussion got to the conclusion that funct= ions that depend on the locale cannot be immutable. Note that the top-lev= el functions lower, upper, and initcap themselves are immutable. > I assume you mean that they=E2=80=99re set at initdb time, so there=E2=80= =99s no mutability concern? = Yeah, I think Peter's right and I'm wrong. Obviously this ties into our philosophical debate about how immutable is immutable. But as long as the functions only depend on locale settings that are fixed at database creation, I think it's okay to consider them immutable. If you were, say, depending on LC_NUMERIC, it would clearly be unsafe to consider that immutable, so I'm not quite sure if this is the end of the discussion. But for what's mentioned in the thread title, I think we only care about LC_CTYPE. regards, tom lane