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.96) (envelope-from ) id 1vJG4p-00GTB6-1t for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Nov 2025 19:00:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vJG4n-00DkAu-17 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Nov 2025 19:00:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vJG4C-00DgKN-3D for pgsql-hackers@lists.postgresql.org; Wed, 12 Nov 2025 18:59:41 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vJG4B-007OTf-0C for pgsql-hackers@postgresql.org; Wed, 12 Nov 2025 18:59:40 +0000 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-343514c7854so4699a91.1 for ; Wed, 12 Nov 2025 10:59:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1762973977; x=1763578777; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=32m72MksPd/AC0axOZuw89zkrAdUoVXcjrD5FBt/mNQ=; b=npjGxU/dYjT9NJXXaQqMWA1V9EqF1sgMe2MknTu8PkAKPKNUEFJ/SIkk1aqA6WnySk O1Zrf2R0hzqRjvgN/F+ghWu7T0Y1214D38cRjgrpnmdH2amBpQi3ne6kgTyYb8VIiiHf HTcBtT+zDugHOiVYqXh+4/q+ZU7T3TjWvguvrXFasHCRsdOQmnEyMFSLHPrEqPdLJCF1 nD9XyA/rWv8A5HqVT5lRbOdIh2Yse7ooJBKMBBs9nwiR3gPMISSutCRvUXSz4+K8VQZ5 Gw51ICgd5HZKeCdfGvpg3tcE5N6waDMRcCoY8TGDk5oP8ZNCJ5a4B309KEd25wHFmG/0 LVvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762973977; x=1763578777; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=32m72MksPd/AC0axOZuw89zkrAdUoVXcjrD5FBt/mNQ=; b=OpE6uotPUkwzQWLNoTnkiP+qshfKQU9QjnYAJdmrdvbOFlWmWYSk0O64/wwYVxkN4u KKwByc7e763tsdv2f18WMWsjVGbBVoBKUtRj0DRmJZSbioctO/G/NlCYlqvm1EbMt22S KfN5E96/IavrgY7Smd7hxl/z5sWJZaZXuw09jPXXoM+eQs+xLUGbHrE4bWXqIV3MRGkU sRllG81rvwZVez1K2zJIpXsD2RA8q1UziGnU+/d5oOAWlF2YCLZLtLLAI2jdbI2rtUz8 flnzd6Oc6pKRo040hLmthKJd0/kSLIuctkBk2m8t1+mYUB5X8OxR2bsatJzOjj7gTAKc vw+A== X-Forwarded-Encrypted: i=1; AJvYcCVSI/s98V69C8tt6Qyz4eh9JvQqz/z2u40fRLyIlIDXLLlMOQiWP4LYrodlAjviGWKq7TThQr9jiwO6008b@postgresql.org X-Gm-Message-State: AOJu0Yysl6HnpKAEO6jfp/NR9jtPaKcMEdccfOZBpFGngHpFRFkMqGFJ +1Pd48OlodvYQs+krIf5/apaZ/pxcNOAGiPi3hEh/VE9YcK9wBeK+Phz/3j7D29+C7D7O4yKDfz wq7Q= X-Gm-Gg: ASbGncu/8SOMhKme98pyA/fQPsFzOWhCXukEQVign03mnkzT0B8LSr0YD3Ibg2lpLZm KrtBwUyKcETeQKcE6S/bSKKO5kxverJvC1Jq2xPhWVPb7Pf6GeoC+skHTeuGJPlT6mFFUr3a9sq 4BKJyP5C2etYVDbTJzTOWYZL8sJhcgZrKxmps1rUbJQLMIn1nsT/g7flMELaK5Z3zUSDb151dZm ZIGwUaxeD4jntp+ok+mTGzXzGbq/wcZ0ekTGWiQz6IYfwGOcHmzd4qqvbsTh08tWzxdK2fqkOSY gzOXn0YeMHOZnkYCrSf/86fGpibFgtp4ryX2YDPHAOLzhOQh4+Ii7KrlG5Xf6IRT1pSJIpm8PkE WqVjfz1vzuICWVuqaXy/bPyp+2Do2Dy35mpMjSWmLrsBTi3dX3KlbxwigLJbKEuJWe9cxkf4bNG IdotZT2SMV+Q6z1wHpOO+66sgwDS9wt7zi X-Google-Smtp-Source: AGHT+IGfhSI/bS+5NR9kIL6p1JlV41PQYX+TaAoY7Qky7zFcWi0UZZY7xnDN+K0TErsJABzcfxu+/w== X-Received: by 2002:a17:90b:1c0e:b0:32e:23c9:6f41 with SMTP id 98e67ed59e1d1-343eab45c3amr542088a91.5.1762973976806; Wed, 12 Nov 2025 10:59:36 -0800 (PST) Received: from jeff-ws-bridge.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7b0cd05d593sm19234917b3a.73.2025.11.12.10.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Nov 2025 10:59:36 -0800 (PST) Message-ID: <68c4928b1ad1fdda96511a4e22d9c8fbd9eb95e8.camel@j-davis.com> Subject: Re: Remaining dependency on setlocale() From: Jeff Davis To: Peter Eisentraut , Daniel Verite Cc: Thomas Munro , Tom Lane , pgsql-hackers@postgresql.org Date: Wed, 12 Nov 2025 10:59:35 -0800 In-Reply-To: <215d5fa1-49c7-487c-a6be-e772c0b46805@eisentraut.org> References: <5e709c7a-0504-426c-8a7d-e0701c334cd7@manitou-mail.org> <215d5fa1-49c7-487c-a6be-e772c0b46805@eisentraut.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-11-12 at 19:41 +0100, Peter Eisentraut wrote: > The impact area of LC_CTYPE is much larger and more complicated=20 > and possibly interacts with other settings and third-party libraries > in=20 > ways that we don't understand yet and might not be able to change.=20 > That's why I'm more hesitant about it. What do you think about making lc_ctype and/or lc_collate into GUCs (like lc_messages), assuming we remove all known effects in the backend first? If we make the setting PGC_POSTMASTER, then it eliminates potential problems with threading, because setlocale() would be called only once before allowing connections. For platforms that support uselocale(), we could allow it to be set more freely, for those who need it set to different values in different backends. It would also be easier to document, which would be nice. There could be some confusion if various settings are inconsistent with each other, but that's true currently. And we'd still enforce a ctype that's consistent with the encoding, at least. Regards, Jeff Davis