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 1q0Y6D-0003kX-Uy for pgsql-hackers@arkaria.postgresql.org; Sun, 21 May 2023 01:43:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q0Y6C-0005Hz-Ry for pgsql-hackers@arkaria.postgresql.org; Sun, 21 May 2023 01:43:04 +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 1q0Y6C-0005Hq-Fu for pgsql-hackers@lists.postgresql.org; Sun, 21 May 2023 01:43:04 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q0Y67-0015II-2c for pgsql-hackers@lists.postgresql.org; Sun, 21 May 2023 01:43:03 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1ae763f9c0bso21323805ad.2 for ; Sat, 20 May 2023 18:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1684633378; x=1687225378; 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=6Uxz7QDQMx+ycQuqSofz8zf4qEaqmrCvPL9feIRkKwY=; b=3+mpwy+lbuR0MsszDJ3uZaPxmZYan8mTtFl+Qv36Jk/Xc+c8SBj/bawNORsOTfhsMm Le4baQ3dB/NGI2ZIOz9BXfXtEMzhxDZn92jcgZtHF3cMNJb6V+iqKiC8WcKBxbm/Vy7I UXNqxsRt+G/YYXdN3mpLiHd5kLJcJiTB8Hv8rPrk1RGCY8V2xaFqb8yfv7WUxEzJl3pw TvZElxY/laD86PFOyqRtmWfQx1LpeM7RQx2KMDKytiA23TRoZoqP2DGorG8Lem16wZxm 9BGxCQPp747LZNBG7IWldheAZ17RxJhuGbEYKR4qklxGHGgNCa90P+Pe5yh5cLxtDi7o FN3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684633378; x=1687225378; 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=6Uxz7QDQMx+ycQuqSofz8zf4qEaqmrCvPL9feIRkKwY=; b=ZIgzREqP1+2j2JbhFhq5Na7JvzLCNXQimNusmfcIVIgqWwmcX6/YP6wTJOv4AnoM0D 5oHzOlF1LFvEHDnIigqI+XzILSaozDjQAQZ95jnWPdCHuxwFXbsLNBJgON9Ql/2flFwt CXMmt0wHkqEEPc/F7swm6Jw0qiOC3LELOkzMMYxvDC+ph4Y9EOY6qtSPDgyHK8B8r3S2 n8SpbLpUsLJPyplLVFIB6NlAztqpnjWAL3i6SYtsvtAAmUFG0Mwa4okGHCgnj1IiAr9D RMsizUjohZCJjbpVr8dX7KCrxDE6bfang0WmqHetBIZ38xqJ/nptGHyjXzX/x+CTP9YU nszg== X-Gm-Message-State: AC+VfDzdflQej8WO+gA9Za2bOlRCG2dJkCzVN4jelwsCf2JF5Ey1ICdk uLkR3P2i6BBhyTRwacyFhWWwuQ== X-Google-Smtp-Source: ACHHUZ54TVu+4glqXjUYGIlFfa3el9tE7tqZPqgxojuW5cpAncagKOF3kDOa/skP/Om+Twj9QIhwLQ== X-Received: by 2002:a17:902:ba8c:b0:1ae:6290:26d with SMTP id k12-20020a170902ba8c00b001ae6290026dmr7380810pls.7.1684633378027; Sat, 20 May 2023 18:42:58 -0700 (PDT) Received: from jeff-laptop.lan (c-73-170-46-202.hsd1.ca.comcast.net. [73.170.46.202]) by smtp.gmail.com with ESMTPSA id t18-20020a170902d21200b001acad86ebc5sm2135532ply.33.2023.05.20.18.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 May 2023 18:42:57 -0700 (PDT) Message-ID: <7de366ed73a6a68c30dd37e32ed740298cfe50b3.camel@j-davis.com> Subject: Re: Order changes in PG16 since ICU introduction From: Jeff Davis To: Daniel Verite Cc: Matthias van de Meent , Andrew Gierth , Peter Eisentraut , Sandro Santilli , Tom Lane , Regina Obe , pgsql-hackers@lists.postgresql.org Date: Sat, 20 May 2023 18:42:55 -0700 In-Reply-To: <360c90b9-7c20-4cec-aade-38e6e3351c05@manitou-mail.org> References: <360c90b9-7c20-4cec-aade-38e6e3351c05@manitou-mail.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2023-05-19 at 21:13 +0200, Daniel Verite wrote: > ISTM that if we want to go that route, we need the make the minimum > changes at the user interface level and not any deeper, so that when > (locale=3D"C" OR locale=3D"POSIX") AND the provider has not been > specified, > then the command (initdb and create database) act as if the user had > specified provider=3Dlibc. If we special case locale=3DC, but do nothing for locale=3Dfr_FR, then I'm not sure we've solved the problem. Andrew Gierth raised the issue here, which he called "maximally confusing": https://postgr.es/m/874jp9f5jo.fsf@news-spur.riddles.org.uk That's why I feel that we need to make locale apply to whatever the provider is, not just when it happens to be C. > > (3) Support iculocale=3DC in the ICU provider using the memcmp() > > path. >=20 > > In other words, if provider=3Dicu and iculocale=3DC, lc_collate_is_c() > > and > > lc_ctpye_is_c() would both return true. >=20 > ICU does not provide a locale that behaves like that, and it doesn't > feel right to pretend it does. It feels like attacking the problem > at the wrong level. I agree that #3 feels slightly wrong, but I think it's still a viable option until we have consensus on something better. > > (4) Create a new "none" provider (which has no locale and always > > memcmp > > semantics), and automatically change the provider to "none" if > > provider=3Dicu and iculocale=3DC. >=20 > It still uses libc/C for character classification and case changing, > so "no locale" is technically not true. The provider affects callers that have a pg_locale_t, such as the SQL- callable lower() function. For those callers, the "none" provider=C2=A0uses pg_ascii_tolower(), etc., not libc. That's why I called it "none" -- it's using simple internal postgres implementations instead of a provider. For callers that don't have a pg_locale_t, they may call libc functions directly and rely on the server environment. But in those cases, there's no way to set a provider at all, it's just relying on the server environment. There aren't many of these cases, and hopefully we can eliminate the reliance on the server environment over time. If I'm missing something, let me know what cases you have in mind. Regards, Jeff Davis