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 1qGJV8-0001TE-4W for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jul 2023 13:21:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qGJV6-0001Od-Up for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jul 2023 13:21:56 +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 1qGJV6-0001Ml-Hk for pgsql-hackers@lists.postgresql.org; Mon, 03 Jul 2023 13:21:56 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qGJV3-001xBM-Hp for pgsql-hackers@postgresql.org; Mon, 03 Jul 2023 13:21:55 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-392116b8f31so3081069b6e.2 for ; Mon, 03 Jul 2023 06:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1688390511; x=1690982511; 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=U6bnvMsA2ApJCx39mfw7NoSBhT3sTvb9pYGbzbgwqVE=; b=Ub6unMarQt7B/kvbigenQra8CO2xjTdC+lRnd0iTEiEb8aYcKczRYL2U+A3FLWJEQK pzq05EEJFNyKK/0SvHX7OvNfH3pg8Dex5mptycwCqqtaLsqPWq8/YdnfZXAw5kD2OZLr jRGaFETlfb+kuaBCGDYwHoAjj/9J+T7b4sfgua5GkDRPl5KwLoOWx1g6zt+jyYHqDCsf 5sR64bo8NJ7c0gCNwTHMXqgsAyXbu3i6gYiXC9la2uoCmeL26qt5w8NpUuL1/lx+usas 2D9GF88/J1l+FCnCUhgCFfEqKk1mm6uyROfg16zbTJ0XrABADZSU3dcRQzoXpa0Q7MI0 nMsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688390511; x=1690982511; 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=U6bnvMsA2ApJCx39mfw7NoSBhT3sTvb9pYGbzbgwqVE=; b=SACiNtSIqdHHAnjDPboSBDIaeQnLoirw4HshU4lBExeTiKOEftO5BEZEnEG3RPe3Qv w/47d8gzfxde2wkq4lxwL8OHbZkTIwqTuA/VIZHM6elT3IFrkUoyHMK6bZWRhvHIIZ6I op/DB8SRMylgT0xylgyztn4+mO6EqmOQ9hUgyJhKLNXRkeMnULNvQZ3iekGqR+f5AN9m JZlYvwYG66tcfbiLyGGVmZkDRplRH3A8QM4zkIj7gwyMGG4lbfTUdJBjfdXH5oOfvB8h e3GJcGndO0aji861olekP51dyCFJfm9RR2WDAZVyzKAV9uPU8ZY06AZsTZG7Q0/i8ik6 IBxg== X-Gm-Message-State: ABy/qLZ5E4ebOJwtKYjH7VKRW0OYsBDjxrvj92IcbnGiIIylR6gdSMep 6MyUjrR9J40SlVjCg9rixnQo9w== X-Google-Smtp-Source: APBJJlEfgVjql2dIVpL0dFFfE5493zQwCNCiTXGEb781WYBV5/+z+2NN9i6z/c8eyP7MBrWtAR4eMQ== X-Received: by 2002:a05:6808:15:b0:3a3:9ee4:f694 with SMTP id u21-20020a056808001500b003a39ee4f694mr5509377oic.13.1688390511562; Mon, 03 Jul 2023 06:21:51 -0700 (PDT) Received: from localhost ([2607:fb90:f280:130d:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id t18-20020a056808159200b003a1e7d8f38bsm7108780oiw.27.2023.07.03.06.21.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Jul 2023 06:21:51 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 03 Jul 2023 08:21:50 -0500 Message-Id: Cc: Subject: Re: Make uselocale protection more consistent To: "Thomas Munro" , "Peter Eisentraut" From: "Tristan Partin" X-Mailer: aerc 0.15.2-76-g69094e332779 References: 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 1:24 AM CDT, Thomas Munro wrote: > On Mon, Jul 3, 2023 at 6:13=E2=80=AFPM Peter Eisentraut wrote: > > On 27.06.23 17:02, Tristan Partin wrote: > > > This is a patch which implements an issue discussed in bug #17946[0].= It > > > doesn't fix the overarching issue of the bug, but merely a consistenc= y > > > issue which was found while analyzing code by Heikki. I had originall= y > > > submitted the patch within that thread, but for visibility and the > > > purposes of the commitfest, I have re-sent it in its own thread. > > > > > > [0]: https://www.postgresql.org/message-id/49dfcad8-90fa-8577-008f-d1= 42e61af46b@iki.fi > > > > I notice that HAVE_USELOCALE was introduced much later than > > HAVE_LOCALE_T, and at the time the code was already using uselocale(), > > so perhaps the introduction of HAVE_USELOCALE was unnecessary and shoul= d > > be reverted. > > > > I think it would be better to keep HAVE_LOCALE_T as encompassing any of > > the various locale_t-using functions, rather than using HAVE_USELOCALE > > as a proxy for them. Otherwise you create weird situations like having > > #ifdef HAVE_WCSTOMBS_L inside #ifdef HAVE_USELOCALE, which doesn't make > > sense, I think. > > I propose[1] that we get rid of HAVE_LOCALE_T completely and make > "libc" provider support unconditional. It's standardised, and every > target system has it, even Windows. But Windows doesn't have > uselocale(). > > [1] https://www.postgresql.org/message-id/flat/CA%2BhUKGL7CmmzeRhoirzjECm= OdABVFTn8fo6gEOaFRF1Oxey6Hw%40mail.gmail.com#aef2f2274b28ff8a36f9b8a598e3ce= c0 I think keeping HAVE_USELOCALE is important for the Windows case as mentioned. I need it for my localization work where I am ripping out setlocale() on non-Windows. --=20 Tristan Partin Neon (https://neon.tech)