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 1q1Aot-0000cu-QT for pgsql-hackers@arkaria.postgresql.org; Mon, 22 May 2023 19:03:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q1Aos-0002A7-OK for pgsql-hackers@arkaria.postgresql.org; Mon, 22 May 2023 19:03:46 +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 1q1Aos-00029y-C4 for pgsql-hackers@lists.postgresql.org; Mon, 22 May 2023 19:03:46 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q1Aol-001Snn-B8 for pgsql-hackers@lists.postgresql.org; Mon, 22 May 2023 19:03:45 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1a516fb6523so58826305ad.3 for ; Mon, 22 May 2023 12:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1684782218; x=1687374218; 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=7r/QybZJ1PgnnbQeVBP5qjIqoAsnGj0Clvnm0rkQmhg=; b=WXSIdYzSXMtMaDesVVrhkuzTiDV63Ivodl/9TyMwhrXYaYm62GrmjVDLUrrvB1JlN0 Az7jpjSVDuFeWVUdPrqTv4IQzBsyelIsN+BK86nOErEoD2Wd4yGd3Zm9U3q0u/4ABVCD 48Lp0XgzLWC9oG7keV13eDXbSoBgjzhANEdfI1k10Rsk9s6Vp+aA+/OgUWrIk6xlroqq 8x5jUm9piV9a/58OPr1KjH7DOxuLeqdh/kXZuwYkubwmEIxcuE1BiKyYY/dVUI5Niyvj orTUkkzCcTTT3iDJynx8AR4kP2dNsOJYxtcUGTy8u9kYXnVrdnJhQ5mBWfJPBhd7r8Q0 0YdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684782218; x=1687374218; 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=7r/QybZJ1PgnnbQeVBP5qjIqoAsnGj0Clvnm0rkQmhg=; b=Jur+k7FLbWn8dhhfBKqIbGhZdaAIFB4MWfTbpDI/peBiPT6HAPwYF0Y7doj4zRrAci v95fqcSBo8HNHL5eADkCW0kiID7187ogQXMsfaTu4wXHctLDu6VQTTovdO4ttKB4JcL6 3UED/mUOJ3YfhKBJ+DfzXeUelXEOMgQ9vORvAH4jy8t5akvEea67vkGRNja2TLMPI86Q 6DlF6kgBQCdVFYuP6kE0pLMapH0lw3gGnPTucvY9Nf+PR7qbsFhzGBU2upE3TAINNlC/ jEdzzJ0DsAnLsf1eXzr3Huh7RkL4ZYADpujZtlE18dHQwfaedkixyqRqRG34+aIHQGHG rWag== X-Gm-Message-State: AC+VfDwOlMOypa6cRx2hPGK0MprKSk7zEUM0DkWxBII+ktNUq8SCMzw5 InXxyp8PrVCLsYjTt+W7CCXKgg== X-Google-Smtp-Source: ACHHUZ6VJxM4ZTGzaFyzCrHHDVy8tzi6Tr2AIR5IAF4Y4TUSC4uLtgR3L6CSHIcRwZf7Wfs5JhLvQw== X-Received: by 2002:a17:902:f689:b0:1a0:7156:f8d1 with SMTP id l9-20020a170902f68900b001a07156f8d1mr14513748plg.19.1684782217955; Mon, 22 May 2023 12:03:37 -0700 (PDT) Received: from [192.168.86.49] (c-73-170-46-202.hsd1.ca.comcast.net. [73.170.46.202]) by smtp.gmail.com with ESMTPSA id s10-20020a170902ea0a00b001a95f632340sm5181416plg.46.2023.05.22.12.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 12:03:37 -0700 (PDT) Message-ID: <4e3281d1ba5950dbe3b5d3c8d511da4c5751217a.camel@j-davis.com> Subject: Re: Order changes in PG16 since ICU introduction From: Jeff Davis To: Peter Eisentraut , "Jonathan S. Katz" , Robert Haas Cc: Tom Lane , Regina Obe , Sandro Santilli , pgsql-hackers@lists.postgresql.org Date: Mon, 22 May 2023 12:03:36 -0700 In-Reply-To: <74706bb8-4fb0-fbab-7e88-648ae04f2588@enterprisedb.com> References: <000b01d97465$c34bbd60$49e33820$@pcorp.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> <7ee07b7d5aa4fb0b47e5657640568fdd25ba168f.camel@j-davis.com> <2ffe8ffb9291b9390b9ed6c1e34b4fae8e8ce324.camel@j-davis.com> <25787ec7-4c04-9a8a-d241-4dc9be0b1ba3@postgresql.org> <605324592391599a7ecd522087edbd00720793b7.camel@j-davis.com> <52553877-7966-e25f-6c74-a974a504250e@postgresql.org> <74706bb8-4fb0-fbab-7e88-648ae04f2588@enterprisedb.com> 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 Mon, 2023-05-22 at 14:27 +0200, Peter Eisentraut wrote: > The rules are for setting whatever sort order you like.=C2=A0 Maybe you > want=20 > to sort + before - or whatever.=C2=A0 It's like, if you don't like it, > build=20 > your own. A build-your-own feature is fine, but it's not completely zero cost. There some risk that rules specified for ICU version X fail to load for ICU version Y. If that happens to your database default collation, you are in big trouble. The risk of failing to load a language tag in a later version, especially one returned by uloc_toLanguageTag() in strict mode, is much lower. We can reduce the risk by allowing rules only for CREATE COLLATION (not CREATE DATABASE), and see what users do with it first, and consider adding it to CREATE DATABASE later. We can also try to explain in the docs that it's a build-it-yourself kind of feature (use it if you see a purpose, otherwise ignore it), though I'm not sure quite how we should word it. And I'm skeptical that we don't have a single plausible end-to-end user story. I just can't think of any reason someone would need something like this, given how flexible the collation settings in the language tags are.=C2=A0The best case I can think of is if someone is trying to make an ICU collation that matches some non-ICU collation in another system, which sounds hard; but perhaps it's reasonable to do in cases where it just needs to work well-enough in some limited case. Also, do we have an answer as to why specifying the rules as '' is not the same as not specifying any rules[1]? [1] https://www.postgresql.org/message-id/36a6e89689716c2ca1fae8adc8e84601a0411= 21c.camel@j-davis.com > The co settings are just everything else.=20 > They are not parametric, they are just some other sort order that=20 > someone spelled out explicitly. This sounds like another case where we can't really tell the user why they would want to use a specific "co" setting; they should only use it if they already know they want it. Is there some way we can word that in the documentation so that people don't misuse them? For instance, one of them is called "emoji". I'm sure a lot of applications use emoji (or at least might encounter them), should they always use co-emoji, or would some people who are using emoji not want it? Can it be combined with "ks" or other "k*" settings? What I'm trying to avoid is users seeing something in the documentation and using it without it really being a good fit for their problem. Then they see something unexpected, and need to rebuild all of their indexes or something. > > * I don't understand what "kc" means if "ks" is not set to > > "level1". >=20 > There is an example here:=20 > https://peter.eisentraut.org/blog/2023/05/16/overview-of-icu-collation-se= ttings#colcaselevel Interesting, thank you. Regards, Jeff Davis