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 1ppwvc-0002ON-SO for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Apr 2023 20:00:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ppwvb-0003B4-P8 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Apr 2023 20:00:19 +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 1ppwvb-0003Au-Fa for pgsql-hackers@lists.postgresql.org; Fri, 21 Apr 2023 20:00:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ppwvZ-004IaU-2h for pgsql-hackers@lists.postgresql.org; Fri, 21 Apr 2023 20:00:18 +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 33LK09uS3391933; Fri, 21 Apr 2023 16:00:09 -0400 From: Tom Lane To: Jeff Davis cc: Regina Obe , "'Peter Eisentraut'" , "'Sandro Santilli'" , pgsql-hackers@lists.postgresql.org Subject: Re: Order changes in PG16 since ICU introduction In-reply-to: References: <000b01d97465$c34bbd60$49e33820$@pcorp.us> <3353947.1682092131@sss.pgh.pa.us> <533d93c5-f604-8e5f-4a48-975c08c53d59@enterprisedb.com> <3365333.1682098091@sss.pgh.pa.us> <002d01d97477$f0395640$d0ac02c0$@pcorp.us> <3367226.1682099185@sss.pgh.pa.us> <003b01d9747a$910471c0$b30d5540$@pcorp.us> <3368986.1682099982@sss.pgh.pa.us> <000001d9747d$066b7560$13426020$@pcorp.us> <3372735.1682101425@sss.pgh.pa.us> Comments: In-reply-to Jeff Davis message dated "Fri, 21 Apr 2023 12:25:00 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3391931.1682107209.1@sss.pgh.pa.us> Date: Fri, 21 Apr 2023 16:00:09 -0400 Message-ID: <3391932.1682107209@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis writes: > I have a couple ideas: > 1. Introduce a "none" provider to separate the concept of C/POSIX > locales from the libc provider. It's not really using a provider > anyway, it's just using memcmp(), and I think it causes confusion to > combine them. Saying "LOCALE_PROVIDER=none" is less error-prone than > "LOCALE_PROVIDER=libc LOCALE='C'". I think I might like this idea, except for one thing: you're imagining that the locale doesn't control anything except string comparisons. What about to_upper/to_lower, character classifications in regexes, etc? (I'm not sure whether those operations can get redirected to ICU today or whether they still always go to libc, but we'll surely want to fix it eventually if the latter is still true.) In any case, that seems somewhat orthogonal to what we're on about here, which is making the behavior of CREATE DATABASE less surprising and more backwards-compatible. I'm not sure that provider=none can help with that. Aside from the user-surprise issues discussed up to now, pg_dump scripts emitted by pre-v15 pg_dump are not going to contain LOCALE_PROVIDER clauses in CREATE DATABASE, and people are going to be very unhappy if that means they suddenly get totally different locale semantics after restoring into a new DB. I think we need some plan for mapping libc-style locale specs into ICU locales so that we can make that more nearly transparent. > 2. Change the CREATE DATABASE syntax to catch these errors better at > the possible expense of backwards compatibility. That is the exact opposite of what I think we need. Backwards compatibility isn't optional. Maybe this means we are not ready to do ICU-by-default in v16. It certainly feels like there might be more here than we want to start designing post-feature-freeze. regards, tom lane