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 1r3LBM-003Do2-Lb for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Nov 2023 19:04:12 +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 1r3LBL-001ptX-4O for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Nov 2023 19:04:11 +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.94.2) (envelope-from ) id 1r3LBK-001ptP-RN for pgsql-hackers@lists.postgresql.org; Wed, 15 Nov 2023 19:04:10 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r3LBH-006bfR-VG for pgsql-hackers@postgresql.org; Wed, 15 Nov 2023 19:04:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3AFJ43T82733242; Wed, 15 Nov 2023 14:04:03 -0500 From: Tom Lane To: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= cc: "Tristan Partin" , "pgsql-hackers" Subject: Re: On non-Windows, hard depend on uselocale(3) In-reply-to: <87y1eyn9ig.fsf@wibble.ilmari.org> References: <2689177.1700070346@sss.pgh.pa.us> <87y1eyn9ig.fsf@wibble.ilmari.org> Comments: In-reply-to =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= message dated "Wed, 15 Nov 2023 18:42:31 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2733240.1700075043.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 15 Nov 2023 14:04:03 -0500 Message-ID: <2733241.1700075043@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =3D?utf-8?Q?Dagfinn_Ilmari_Manns=3DC3=3DA5ker?=3D writ= es: > Tom Lane writes: >> "Tristan Partin" writes: >>> I would like to propose removing HAVE_USELOCALE, and just have WIN32, = >>> which means that Postgres would require uselocale(3) on anything that = >>> isn't WIN32. >> You would need to do some research and try to prove that that won't >> be a problem on any modern platform. Presumably it once was a problem, >> or we'd not have bothered with a configure check. > For reference, the Perl effort to use the POSIX.1-2008 thread-safe > locale APIs have revealed several platform-specific bugs that cause it > to disable them on FreeBSD and macOS: > https://github.com/perl/perl5/commit/9cbc12c368981c56d4d8e40cc9417ac26be= c2c35 > https://github.com/perl/perl5/commit/dd4eb78c55aab441aec1639b1dd49f88bd9= 60831 > and work around bugs on others (e.g. OpenBSD): > https://github.com/perl/perl5/commit/0f3830f3997cf7ef1531bad26d2e0f13220= dd862 > But Perl actually makes use of per-thread locales, because it has a > separate interpereer per thread, each of which can have a different > locale active. Since Postgres isn't actually multi-threaded (yet), > these concerns might not apply to the same degree. Interesting. That need not stop us from dropping the configure check for uselocale(), but it might be a problem for Tristan's larger ambitions. regards, tom lane