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 1uNImL-00GXBB-N5 for pgsql-general@arkaria.postgresql.org; Thu, 05 Jun 2025 22:09:42 +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 1uNImJ-00Fvx3-G1 for pgsql-general@arkaria.postgresql.org; Thu, 05 Jun 2025 22:09:40 +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 1uNImJ-00Fvwv-1R for pgsql-general@lists.postgresql.org; Thu, 05 Jun 2025 22:09:39 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uNImH-000QvE-2K for pgsql-general@postgresql.org; Thu, 05 Jun 2025 22:09:39 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-23539a1a421so13988795ad.0 for ; Thu, 05 Jun 2025 15:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1749161375; x=1749766175; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=FXvJKxCaOf1el/heA9+05V9nTBxtu3RRO8c/aciY1a8=; b=RdYTEfIo7plG4O3991ZuVrAQlSPlT1oBmXcdJYQFKWbChLF3YMPSd0jFSKhRB7SHbJ 4bFpegUT2ku9wfb+d3q8l64waitKKmT54kjO+RKKCmPMxvilgSLxW+wAHFcJNWk8JazY Hj3E7w4+0e9lD8l0SubOazcu/Qk5hTOEVJ3LOTXSzB76cdLet6ah2THucO7mLmd0A61m gj91a8GTZ9qH+w8urkumRdIJ0W70ukzRG0pVo5uvzUL2Jvfp6AzkmEjT9RuTutk3C8so 5gYjHLjtbGWAcHAu8eY3BEyFX42M4YemDV/i7QO8j2A+CmIc9nCg1aIj7FcI0lG3H93X uIzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749161375; x=1749766175; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FXvJKxCaOf1el/heA9+05V9nTBxtu3RRO8c/aciY1a8=; b=OjWE396+lARwD3MQ4A1M+MCVQq4J6BT51LTtwvkO/ryrZRaushW/tiHGeagOkay1fE nqJg89boMQt4WSLM2WRMQxFRM/3nPcjFGBh/13YC/ue/7IYYrKxq1tY4fktsenrUg56m A8thFvtQ6yA6tvf8WA78O9HwfsDXntfc6D+h1ILOaAfINIPoDTLBS9yVpEPyQ4HqBUvX a+xcxxB1A2tNup1iYk739tOoMFyTwxWewoTWx707pCsSI45ozYJeejcJpOhztMRJfouj uAexrC1qiFwRWACY4OkKXlo4zsSJM8OiB3xok8azSsnskll3Xl+aimWk1KSSR6r/wZSP an4A== X-Gm-Message-State: AOJu0YzHA7+fuQiKNr16+9I4n/Xyr3LDXTB9hdnwpv0RA9Co4e6dmpzU BFGxvSCPMHoA2wynLThPhgubP7gk3LBmNYNpb01o9LTU/H1Ca57UHxEojS0xywIZyFZH+251KOO UhPA= X-Gm-Gg: ASbGncurNkJVIsFnPZzf+kGHgY0mFEZFUqSwgPQWB9AWk1uAGz0SlokSf9CU5xoVo9z kn0VJVseyumtRzUVuwGp8sbHoNlfjMRNje0seTW879Z3ECYTTtHu1Q4YqdBJwQZExHc+4PFtGoO Kd/XW6PbanAC1a6UoxkLFZ1Ec66QbwX/jq6/P0KqsINMC/Xnjx0UnyQgzPJrMzKjejo8qqiDGKV hB4k++SuSPephtWdEL+2NOF/cO5wOOxyusgLcSURY8twhr+xRjMYyMwPIQ+Kij7podLhpoYWZG0 D+16J9O2Q+toUz2oK30Vx2yI+J74+9+eQYWiyVb5VMm9daOUhjreshR1C1TjGvzTJwddjpKEQBC 004gliSM1U65qe3AMbZH77qt333SoEimPif8KMtXODYI= X-Google-Smtp-Source: AGHT+IHd4SVgdp8QZ83gl0fvfNaUqGioBrQYRtT2czo78GsjyO83iuk/5s2ZFdAoV+55B1TQscXE2A== X-Received: by 2002:a17:903:32d1:b0:234:a139:1215 with SMTP id d9443c01a7336-23601dc4636mr14262685ad.35.1749161375345; Thu, 05 Jun 2025 15:09:35 -0700 (PDT) Received: from jeff-ws-bridge.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-236032fcf17sm895915ad.115.2025.06.05.15.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jun 2025 15:09:34 -0700 (PDT) Message-ID: <6a08a76a1c0ef87cd723cc1346e25f65f370737e.camel@j-davis.com> Subject: Re: LOCALE C.UTF-8 on EDB Windows v17 server From: Jeff Davis To: Dominique Devienne , Laurenz Albe Cc: pgsql-general@postgresql.org Date: Thu, 05 Jun 2025 15:09:34 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2025-06-05 at 10:53 +0200, Dominique Devienne wrote: > If locale_provider is builtin, then locale or builtin_locale must be > specified and set to either C or C.UTF-8. >=20 > It clearly says "locale or builtin_locale", emphasis on the OR. >=20 > So two issues here. > 1) the doc is wrong or misleading on this. The code in dbcommands.c:createdb(): if (localeEl && localeEl->arg) { dbcollate =3D defGetString(localeEl); dbctype =3D defGetString(localeEl); dblocale =3D defGetString(localeEl); } if (builtinlocaleEl && builtinlocaleEl->arg) dblocale =3D defGetString(builtinlocaleEl); if (collateEl && collateEl->arg) dbcollate =3D defGetString(collateEl); if (ctypeEl && ctypeEl->arg) dbctype =3D defGetString(ctypeEl); if (iculocaleEl && iculocaleEl->arg) dblocale =3D defGetString(iculocaleEl); So LC_COLLATE, LC_CTYPE, and BUILTIN_LOCALE all fall back to LOCALE if they aren't set. On windows, it fails because LC_COLLATE and LC_CTYPE fall back to LOCALE, which is "C.UTF-8", which doesn't exist. (I know the CREATE DATABASE command is confusing, but it grew historically and we needed to support previously-working commands.) If you have specific doc suggestions to clarify this, please let me know. > 2) the same command works on Linux, but not Windows. As long as we accept the libc provider, or allow the user to set LC_COLLATE/LC_CTYPE, then there will be some commands that succeed on some platforms and fail on others. Even with ICU, there may be versions that accept a locale and versions that don't. I'd like to make libc less "special" so that users who don't want to use it aren't confronted with errors about things that don't matter to them. I welcome suggestions that can move us closer to that goal without breaking previously-working commands. Regards, Jeff Davis