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 1tDu9p-003y34-Mc for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Nov 2024 23:30:49 +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 1tDu9m-00ABOL-Q7 for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Nov 2024 23:30:46 +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 1tDu9m-00ABOD-GC for pgsql-hackers@lists.postgresql.org; Wed, 20 Nov 2024 23:30:46 +0000 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tDu9j-002xGc-JI for pgsql-hackers@postgresql.org; Wed, 20 Nov 2024 23:30:45 +0000 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-5edf5e74475so28695eaf.1 for ; Wed, 20 Nov 2024 15:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732145442; x=1732750242; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rX3Z/hZ86fHcUft6UvH2ZR7L1ROJKq+9LN0euX9usVY=; b=UYOt2CerdDZVVkUSRKFodCnhaluUtmKYZWuIiItgdSX8aiZiuMrRJTEOezMvUpc8rn WSayi84vQcBBEvuZ3zX02HSgodfM6I35aVXYGWfLOVG5I5VcGdp3d8NFkD1bzocB5xFL VkwyAdlupucr2QwB7dc93L13tWwTBgiFxpiiul9AEM5xJPFnRo09nWyO5YG5e5kuH2sP h+GJNFyEaQc61cVii8dUz4BbBLWsE/y4QMH9Ci+T1xbxGzHWFdRUTE/ySn6u87MH2Ve7 QpfJcgJGiNNuXeCX+IlpWfY7qTs965yw4DEkilWcggA49UAhDriQ9L1Ndv6uyCoQ45lm d0Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732145442; x=1732750242; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rX3Z/hZ86fHcUft6UvH2ZR7L1ROJKq+9LN0euX9usVY=; b=GVrZbqcpvjIeyedYtxZZZPV1CDhXMmJj/pKcmjBVMh6qwZyY1ZQL4T/OskzJawXuqV 4/DgSmdJRgZokz1OMv/A8kiI11ZZwGMr2wiEH/lbb1i/QY6MnCNoc1TD3SC/yEM4h2Hb UPT+KRe467cTefRK26occAVS4ukOu2QgUbs0kuiQDGttRkz8cxKWxDvw+on1Vl9eELJy a/UDiXNZ2yE8X9/yJa1Ar4uC+ldlKd77aWusZewcBl9RM5/6leFM19VQfb8PuGlkRMRa r0dD4k/HiZ1yGHbr0cmcrmaMB99ciooZdEPesTRKI2+LHDAkUFt80CxkOk7k+h8yv6cX Kngg== X-Forwarded-Encrypted: i=1; AJvYcCXo3dYzT5x2kwcVXM6ElIEJtz0rUsE8TWD76cYiOzIXyHJNeuytkt91cT7AolHeJWfmiGRhHXVCdPcCH2VR@postgresql.org X-Gm-Message-State: AOJu0YyRVxkvaB4nqe01tTGBhRVwFILHO34qmnyW81viqa6sL6DznXGD /3eyhtyaVl/I/iEQ68s+qLRHuFjuf2bRviufEfTPbCNriMeDZOKY94qel5OKLxoBLBQS4OvyFPy h+IaxI9JdUodZG/1Hn566MmClVoA= X-Gm-Gg: ASbGnct/7emSz1y6vebVggyDgpS1+phSGLASoaQOn7tQx+oK8p7UHDHJAkUlMv9gpH/ EcoyTqmz3dv4yXsx6DmqwcKXIF+QeRpLR X-Google-Smtp-Source: AGHT+IGZq2zamfFHmqw2cuwmA+523/jkiSANswXYUHj2GOaEqsugrfURRZPN00hewHKz0MLf9Ayl6LmenZCTJo0WCwo= X-Received: by 2002:a05:6830:6403:b0:717:fe19:1b94 with SMTP id 46e09a7af769-71ab2f92c27mr1309564a34.0.1732145442159; Wed, 20 Nov 2024 15:30:42 -0800 (PST) MIME-Version: 1.0 References: <12842.1700083028@sss.pgh.pa.us> <98824.1700089582@sss.pgh.pa.us> <664255.1700245108@sss.pgh.pa.us> <810814.1700261928@sss.pgh.pa.us> <1155474.1700433384@sss.pgh.pa.us> <1330178.1700498443@sss.pgh.pa.us> <423491f5-2eaa-454e-8dc9-037d69c1a8f9@eisentraut.org> In-Reply-To: From: Thomas Munro Date: Thu, 21 Nov 2024 12:30:05 +1300 Message-ID: Subject: Re: On non-Windows, hard depend on uselocale(3) To: Peter Eisentraut Cc: Tristan Partin , Tom Lane , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Nov 20, 2024 at 10:00=E2=80=AFPM Thomas Munro wrote: > OK, do you think these three patches tell the _configthreadlocale() > story properly? (Then after that we can get back to getting rid of > it...) Just by the way, here's another interesting thing I have learned about the msvcrt->ucrt evolution: ucrt introduced UTF-8 support (ie locales can use UTF-8 encoding, and all the standard library char functions work with it just fine like on Unix), but PostgreSQL still believes that Windows can't do that and has a lot of special code paths to work with wchar_t and perform extra conversions. I started nibbling at that[1], but at the time I was still a bit fuzzy on whether we could really rip all that old stuff out yet and harmonise with Unix, as I didn't understand the MinGW/runtime/history situation. It seems the coast is now clear, and that would be a satisfying cleanup. (There's still non-trivial work to do for that though: we allowed weird mismatched encoding scenarios just on that OS, and would need to stop that, which might create some upgrade path problems, needs some thought, see that thread.) [1] https://www.postgresql.org/message-id/CA%2BhUKGJ%3Dca39Cg%3Dy%3DS89EaCY= vvCF8NrZRO%3Duog-cnz0VzC6Kfg%40mail.gmail.com