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 1uNC6V-00Dz71-5S for pgsql-general@arkaria.postgresql.org; Thu, 05 Jun 2025 15:02:03 +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 1uNC6S-00AHQ5-2F for pgsql-general@arkaria.postgresql.org; Thu, 05 Jun 2025 15:02:00 +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 1uNC6R-00AHPx-Nm for pgsql-general@lists.postgresql.org; Thu, 05 Jun 2025 15:02:00 +0000 Received: from dverite2024.planet-service.net ([185.16.44.252] helo=mail.verite.pro) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uNC6Q-000NRu-1i for pgsql-general@postgresql.org; Thu, 05 Jun 2025 15:01:59 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id 51FDE2C0505; Thu, 5 Jun 2025 17:01:56 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: LOCALE C.UTF-8 on EDB Windows v17 server To: "Dominique Devienne" Cc: "Laurenz Albe" ,pgsql-general@postgresql.org In-Reply-To: Date: Thu, 05 Jun 2025 17:01:52 +0200 Message-Id: <5da10da1-c842-43fa-acf8-98a1fe8ddcfd@manitou-mail.org> X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dominique Devienne wrote: > > locale 'C.UTF-8' or lc_collate 'C.UTF-8' lc_ctype 'C.UTF-8' > > cannot work on Windows because Windows does not have a locale > > named C.UTF-8, whereas a Linux system does (well at least recent > > Linuxes. Some old Linuxes don't). >=20 > But isn't the point of the new-in-v17 builtin provider is to be system > independent??? Yes, definitely. But suppose your database has an extension that calls local-dependent code, such as strxfrm() [1] for instance. The linked MSVC doc says: "The transformation is made using the locale's LC_COLLATE category setting. For more information on LC_COLLATE, see setlocale. strxfrm uses the current locale for its locale-dependent behavior" But what will be the value in LC_COLLATE when this extension code is running in a database using the builtin provider? It's the value found in pg_database.datcollate that was specified when creating the database with the lc_collate or locale option. The builtin provider routines are used for code inside Postgres core, but code outside its perimeter can still call libc functions that depend on lc_collate and lc_ctype. [1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strxfrm-w= csxfrm-strxfrm-l-wcsxfrm-l?view=3Dmsvc-170 Best regards, --=20 Daniel V=E9rit=E9=20 https://postgresql.verite.pro/