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 1ppwNX-0000Vi-Tw for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Apr 2023 19:25:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ppwNW-00025s-RS for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Apr 2023 19:25:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ppwNW-00025i-E0 for pgsql-hackers@lists.postgresql.org; Fri, 21 Apr 2023 19:25:06 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ppwNT-0018Ft-SH for pgsql-hackers@lists.postgresql.org; Fri, 21 Apr 2023 19:25:05 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1a6c5acf6ccso20783155ad.3 for ; Fri, 21 Apr 2023 12:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1682105102; x=1684697102; 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=M+nbqelbnxzTw1eyOwec24CvOWWxn/14mrqNEk8jkLs=; b=hjuJ1IvGplo1g9UXsyypcZY4BjeF3ozxiag1FSoAYEzdFxllF2itRAmNR2Qy+XlyFl aBAz7k8vgLD0bPpn82KbvGArB12vwDqFwHVR28dRrNTFXU//3E6j/sz2fkFLrMxtJ1Mv zcjycAAma1Pe5MYFpR4ChLQnYF9meE3F+WWSkvgbeC9N/nQ4GvDV5OWABN32CtB7aiZM tCAWIEozddTknmxUnz0r3pVxitKuG6kZs7ORmvxkRNuTN1djqmyn7thxpxMKNd3Y6T3B IuHTg4dGdfGKdxNpK0AfdO23HyI43l4LIQp9U+qlY+t7eaBzN92YVzoT+9WARqfjJtx9 haOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682105102; x=1684697102; 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=M+nbqelbnxzTw1eyOwec24CvOWWxn/14mrqNEk8jkLs=; b=TMn3Ib5gqehnzJJFSPcQwOj1pOWzKZXnqJlkQK9NXupM9NJ+0BEgWQziNr3L6Q/V0v C4VV93qHF8P6hObgdWigt809OpUwjyq5DWSfU2gX2kPu9aHET/3faE83KUfYimGgntWC sxez00/OgXzye0gcC4E31V2ktts0YLb//X1yeF+N56TPYqE7dSPSICBWt3mx5apuDDG0 uiLbr7RgQhmJ6KFJbS4HIgw0HC83h0mRL5NfewyZ3UcLQwntQe+XKYKn1Ca8F+rAygLI 81dU5NibaRqcpkd3c80sWCHdw7fVXemEKvPe/VzEHnxs4oJTiROjFYgNKxG0vfv+IovV knTg== X-Gm-Message-State: AAQBX9fH4wSDQOSQzGSbhMk2/GAbYHYlYYqEskoj4MWmfx0liivLB0vy BheZpaBfjdeOn+WRnLTqYk1dmQ== X-Google-Smtp-Source: AKy350bgTysUpPjW0qA6wbrm6xGRqPAMgIc9IlvXznKjAA+w413GAl4lA1CwtL7z32r9MiliPTbWvQ== X-Received: by 2002:a17:902:f790:b0:1a6:6fef:62f6 with SMTP id q16-20020a170902f79000b001a66fef62f6mr6684921pln.30.1682105102316; Fri, 21 Apr 2023 12:25:02 -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 jh10-20020a170903328a00b001a6ce2bcb3esm3069614plb.161.2023.04.21.12.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 12:25:01 -0700 (PDT) Message-ID: Subject: Re: Order changes in PG16 since ICU introduction From: Jeff Davis To: Tom Lane , Regina Obe Cc: 'Peter Eisentraut' , 'Sandro Santilli' , pgsql-hackers@lists.postgresql.org Date: Fri, 21 Apr 2023 12:25:00 -0700 In-Reply-To: <3372735.1682101425@sss.pgh.pa.us> 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> 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-04-21 at 14:23 -0400, Tom Lane wrote: > postgres=3D# CREATE DATABASE test1 TEMPLATE=3Dtemplate0 ENCODING =3D 'UTF= 8' > LOCALE =3D 'C'; ... > =C2=A0test1=C2=A0=C2=A0=C2=A0=C2=A0 | postgres | UTF8=C2=A0=C2=A0=C2=A0= =C2=A0 | icu=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 | C=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | > C=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | en-US=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 |=20 > (4 rows) >=20 > Looks like the "pick en-US even when told not to" problem exists here > too. Both provider (ICU) and the icu locale (en-US) are inherited from template0. The LOCALE parameter to CREATE DATABASE doesn't affect either of those things, because there's a separate parameter ICU_LOCALE. This happens the same way in v15, and although it matches the documentation technically, it is not a great user experience. 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=3Dnone" is less error-prone than "LOCALE_PROVIDER=3Dlibc LOCALE=3D'C'". 2. Change the CREATE DATABASE syntax to catch these errors better at the possible expense of backwards compatibility. I am also having second thoughts about accepting "C" or "POSIX" as an ICU locale and transforming it to "en-US-u-va-posix" in v16. It's not terribly useful (why not just use memcmp()?), it's not fast in my measurements (en-US is faster), so maybe it's better to just throw an error and tell the user to use C (or provider=3Dnone as I suggest above)?=C2=A0 Obviously the user could manually type "en-US-u-va-posix" if that's the locale they want. Throwing an error would be a backwards-compatibility issue, but in v15 an ICU locale of "C" just gives the root locale anyway, which is probably not what they want. Regards, Jeff Davis