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 1qH9V7-0002zt-Om for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jul 2023 20:53:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qH9V6-00067z-4W for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jul 2023 20:53:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qH9V5-00067q-RZ for pgsql-hackers@lists.postgresql.org; Wed, 05 Jul 2023 20:53:23 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qH9V2-002PP8-PA for pgsql-hackers@postgresql.org; Wed, 05 Jul 2023 20:53:23 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1b0249f1322so101663fac.3 for ; Wed, 05 Jul 2023 13:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1688590398; x=1691182398; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Ln7qpZWPjQ1v3wQK/IzEgKr4s/o0+1da8WEFqQd7zmA=; b=CJFm5g8jNvmKr7NP8nSXG2zX/DkMpl1wrxtVKzCKEHH677pFpWTLfdEp2CqUpJYXV1 Ij8pA/i8UCwr8jY9NYrfifhXKN7AkXwUiTBOd5R+NjZiHefC6bVtZFx8tkb40IMpOjqB NP4F/sx8QFFAvGOvpZpUdYXsPVRN+rYXBjoAlV0wcrSedNFB1h3cIV1jjnRwBqo0mT+k bKGiKQPCUgKZ05V7Dr2hNqLslBwfab281Ic+0kqOH+RKQEiL4AIOe27dXga3OrkI7mMh Ot5Dqul0bIK4DBdvXKdtmxtuSPYjiO3qI8OUoWSPx0npqnWDpjJ5OB2xOrSt0M06+Xa+ Cxdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688590398; x=1691182398; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Ln7qpZWPjQ1v3wQK/IzEgKr4s/o0+1da8WEFqQd7zmA=; b=lnu1l8D8Bg1lVabX4Ab6nDY88TnX2bVllDR0FQZFXNVkjXEMBEDs6+9UL9uSjmGDCT Qet1TyjeO9Mmec3almUPFrXGNtRCS0bndrLrFTshQ8YwcN5fzHB3egCoyioF8UoX1p1A 5FLMJFV5cTzcaXexUMAoZCZy7zO+Hl+/8cZg2n5lvwnr9PNCqFtEaNcIWxqQhfiLxqeJ IFJHIY+X9WJz1r7/rsDr5OLno0rprsqWINrdRrjAzUACOkEMdTphs+L3PTxxdjYZVUOf U8ApWxzsSoYwhy89rYh/V7qBgPPx1z9y50ynDENFOJ0LWfWZwv4jdTUcd+GMTUIwfyza HO3A== X-Gm-Message-State: ABy/qLbIQ0jnWCRw4usKXL/JuhkxGvS7g6SRgIB74xs+yalNwKlFcIVJ q+xww/AS7rnq426Ofp85RnR5KA== X-Google-Smtp-Source: APBJJlFHpP/G1v4DgzEYRzx8fVgVDQM+/J7H3E2QOUA4Gr18shYmUcNBrNw/+lqmxavI9oRcbW+k1Q== X-Received: by 2002:a05:6870:8288:b0:18e:cdd6:971a with SMTP id q8-20020a056870828800b0018ecdd6971amr139585oae.36.1688590398356; Wed, 05 Jul 2023 13:53:18 -0700 (PDT) Received: from localhost ([2607:fb90:f280:130d:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id g7-20020a056870a24700b001a9eb707366sm67823oai.15.2023.07.05.13.53.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Jul 2023 13:53:17 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 05 Jul 2023 15:53:16 -0500 Message-Id: Cc: "PostgreSQL-development" Subject: Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG To: "Tristan Partin" , , "Heikki Linnakangas" , "Tom Lane" , From: "Tristan Partin" X-Mailer: aerc 0.15.2-76-g69094e332779 References: <17946-3e84cb577e9551c3@postgresql.org> <1564676.1685043220@sss.pgh.pa.us> <555bb26e-c27c-ab65-028f-3fd5b82df9de@iki.fi> <1645ebad-798f-87ad-43ac-72d2bf14d2d6@cd> In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon Jul 3, 2023 at 9:42 AM CDT, Tristan Partin wrote: > Thanks for your patience. Attached is a patch that should cover all the > problematic use cases of setlocale(). There are some setlocale() calls in > tests, initdb, and ecpg left. I plan to get to ecpglib before the final > version of this patch after I abstract over Windows not having > uselocale(). I think leaving initdb and tests as is would be fine, but I > am also happy to just permanently purge setlocale() from the codebase > if people see value in that. We could also poison[0] setlocale() at that > point. > > [0]: https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html Here is a v2 with best effort Windows support. My patch currently assumes that you either have uselocale() or are Windows. I dropped the environment variable hacks, but could bring them back if we didn't like this requirement. I tried to add an email[0] to discuss this with hackers, but failed to add the CC. Let's discuss here instead given my complete inability to manage mailing lists :). [0]: https://www.postgresql.org/message-id/CTUJ604ZWHI1.3PFZK152XCWLX%40gon= k --=20 Tristan Partin Neon (https://neon.tech)