Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q8dDt-0007bp-Hr for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Jun 2023 08:48:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q8dDr-0007NX-1T for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Jun 2023 08:48:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q8dDq-0007NN-KK for pgsql-hackers@lists.postgresql.org; Mon, 12 Jun 2023 08:48:22 +0000 Received: from lahtoruutu.iki.fi ([185.185.170.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q8dDn-001kqP-En for pgsql-hackers@postgresql.org; Mon, 12 Jun 2023 08:48:21 +0000 Received: from [192.168.1.115] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4QflhG1Zxxz49Q1g; Mon, 12 Jun 2023 11:48:14 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1686559694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XXqIeOrrT4kguy82b2auhGFrBx7jDO7JhzY7NW2G2wQ=; b=Tu66x04FuuVUXHO/thS/j70dD9om4jMQ8kJazXteIOwgBhdaX2bIZ9YpxIPCnWD3BzBCT2 +fk1EBXMJmGSfF48iR4nQVkX+XqNBFZF/Ahf5I2abT3odw4O0JuqWe62H/g6ZLKbu0kMQC TH2/72Z1jt0/pdsrSsurlrpCYuzpugJrAF5aatmBUDiheGsQ+MCwj4x4cDKreeedHSRGzS gcjKgrCY5ACb9y8wnfd4gG5tWM18TFf5AFKyrDfCjlJT5FWaUSkNsdao69QHlRKudPuf0N PhULzJ2p3ENK4fYQimgTmjpp1h7yZbul2jQutO898lQwBuVr7d9ozV3m04gaug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1686559694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XXqIeOrrT4kguy82b2auhGFrBx7jDO7JhzY7NW2G2wQ=; b=ZYmNEtLNXkvjvllF7uVGlXA5SutNpRzD1yWOYh0hhAJhCOEIKrKqi5+o1zwToXSpy6Y6Z7 TsKFOCsTFiD92r7Zd9l3s6yrfMM6WkGNaIkYhFvpULmSiUenUK4j0vT8LR1BnKFya6l9Mp QI+dlhELFXKkvCawVN2/EEmp4UXzJXlLPsuymovirFIroF1n955PAqO/lWokW9D2+eUrCN BhhpLZe9UI+V6FFoEJDvFboGrXoMKL1fIjdv2nQooIWAK92ZkWoPENaNbGxIl6qrqb0HoH iUYPUW6Gi8gPc0FtQtlns+NvWEjBD4CqertohK8CdORwXrpetqybES/52oGwjg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1686559694; a=rsa-sha256; cv=none; b=Kv3vY1ShunTsFr7tEwl9IUvh2dSX8U8vygKtPv6/hkQvumPU6Ad9IGijisHFXtN/aKIRSp ZOMfInqUG6r9Waxxdu9R5Cq3xAEZL1eeIHsa5HTrsUJtdJd2QQR42TJjaVEze2d/nRhCy/ 93FpUwgVEgTzt0fcnrqdDO2rsGpOTKxf+qAozid8OxI8xl0Uwol9nau55d/m1eKdSc/WZB NLfBN18pHfwCTaC2/lPanfooafoYCkWpraFWUa77N8kjUJv+9+J753cFIWLBDo/8y4XF0E GMxkm5bMhlMIOct8Lq3tnFCN6lHDEwFo3WMbrtGY1mBjt3tmnRY83fIQVgB/YA== Message-ID: <726eece8-6e9d-9013-0e4a-a1f9e40c09b3@iki.fi> Date: Mon, 12 Jun 2023 11:48:14 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: check_strxfrm_bug() To: Thomas Munro , pgsql-hackers References: Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/06/2023 01:15, Thomas Munro wrote: > There are still at least a couple > of functions that lack XXX_l variants in the standard: mbstowcs() and > wcstombs() (though we use the non-standard _l variants if we find them > in ), but that's OK because we use uselocale() and not > setlocale(), because uselocale() is required to be thread-local. Right, mbstowcs() and wcstombs() are already thread-safe, that's why there are no _l variants of them. > The use of setlocale() to set up the per-backend/per-database > default locale would have to be replaced with uselocale(). This recent bug report is also related to that: https://www.postgresql.org/message-id/17946-3e84cb577e9551c3%40postgresql.org. In a nutshell, libperl calls uselocale(), which overrides the setting we try set with setlocale(). -- Heikki Linnakangas Neon (https://neon.tech)