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 1ozsbQ-0001cU-VP for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Nov 2022 04:52:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozsbP-0000Oi-IH for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Nov 2022 04:52:15 +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 1ozsYN-0004QH-Ue for pgsql-hackers@lists.postgresql.org; Tue, 29 Nov 2022 04:49:08 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ozsYI-0004yC-VP for pgsql-hackers@postgresql.org; Tue, 29 Nov 2022 04:49:07 +0000 Received: by mail-pj1-x1029.google.com with SMTP id k2-20020a17090a4c8200b002187cce2f92so16170807pjh.2 for ; Mon, 28 Nov 2022 20:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20210112.gappssmtp.com; s=20210112; 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=4uwAjEdRg4l7Mn/OOToI2OrbS6QJc/lk3CLpJVcEf0E=; b=hnXInycbORZA9+dBaLcU6dZjpwDMKFthMNIHikai6EF5LK47WoIWjxUnwN89CgT4/d UTXrN7wMMTrXmsbCP5PA8x/v5BeuAE8fH1/S9UBVI7ZaE5cGLw3C2HBxfxrvJOLmEMgy cJo1xD4Y+WtfX17/ULh7wWQmiLoomhfq0aFcb2RsDGKQ5KMPZ6VqGJY0WzghrPVOzGBF oSkTYXJtsedbHpsQwiqbbijH087j9vIeDGsn2pIhuJ3p2LfoClX9XXJTO4zi9STzfI0X KPc5duVBQwEZtWwmkf+ScaY9muEClfEuP6NhDohrIoylt0q7Uw95APdfiljW37JRFc8P zadQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4uwAjEdRg4l7Mn/OOToI2OrbS6QJc/lk3CLpJVcEf0E=; b=nW6bHbaNwN5ZdeYD3guKZJu6LMhizS4xQx4arutQrdHemks2Vdkci5fYe3yURuDeSV K7OqB/dAzgnZKXBWaykLTea8NNuMh1CbND8Kt+77dFTT3/wK/7CWFipuT1bo0lK/YY9r egOBvQfN7inl014pypGKEDhF/gRBxUhcbHS7/yPlx2Hs2X7Yp9tWxvgZjTuu7SC/DVAN YttYbvxv7J9layBx8ARw73jDofX24IImlSvbrFkiau+CC50SOlghLSlIkg8GdJAiU9cN y9leW2nvFaO7U5QIVtxybEgxq2UrgKmuMgv7hYOX0x3KY7GwjOk0VrXDTyJckuV9F7oj xUQA== X-Gm-Message-State: ANoB5pnEBSO5iVvM0NcOLe4O+sO+7IuQx6fFciGTxOUlytf1YoEVVD28 SYsgF8lp5y2xqq4a3vU+rE+oMg== X-Google-Smtp-Source: AA0mqf7ylBRAwxAR3wA8b0asIy46n5nN/9umPUGluZuM8g9ckLH62ATzpeglQwfYOCbESON/kCQs3A== X-Received: by 2002:a17:902:c194:b0:189:6995:660c with SMTP id d20-20020a170902c19400b001896995660cmr18530572pld.48.1669697340598; Mon, 28 Nov 2022 20:49:00 -0800 (PST) Received: from jeff-laptop.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id i190-20020a626dc7000000b0057462848b94sm8824213pfc.184.2022.11.28.20.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 20:49:00 -0800 (PST) Message-ID: <83faecb4a89dfb5794938e7b4d9f89daf4c5d631.camel@j-davis.com> Subject: Re: Collation version tracking for macOS From: Jeff Davis To: Robert Haas , Thomas Munro Cc: Peter Eisentraut , Jeremy Schneider , Peter Geoghegan , "Finnerty, Jim" , "Nasby, Jim" , Tom Lane , pgsql-hackers Date: Mon, 28 Nov 2022 20:48:58 -0800 In-Reply-To: References: <398aabd1-ad95-ba2d-d70a-dd5d90bf6e07@enterprisedb.com> <606bd2baa6d65b38fee6eb23bba40c5da210255b.camel@j-davis.com> <9f8e9b5a3352478d4cf7d6c0a5dd7e82496be4b6.camel@j-davis.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, 2022-11-28 at 14:11 -0500, Robert Haas wrote: > I don't really understand #1 or #5 well enough to have an educated > opinion, but I do think that #1 seems a bit magical. It hopes that > the > combination of a collation name and a datcollversion will be > sufficient to find exactly one matcing collation in a list of > provided > libraries. The advantage of that, as I understand it, is that if you > do something to your system that causes the number of matches to go > from one to zero, you can just throw another library on the pile and > get the number back up to one. Woohoo! But there's a part of me that > worries: what if the number goes up to two, and they're not all the > same? Probably that's something that shouldn't happen, but if it does > then I think there's kind of no way to fix it. With the other > options, > if there's some way to jigger the catalog state to match what you > want > to happen, you can always repair the situation somehow, because the > library to be used for each collation is explicitly specified in some > way, and you just have to get it to match what you want to have > happen. Not necessarily, #2-4 (at least as implemented in v7) can only load one major version at a time, so can't specify minor versions: https://www.postgresql.org/message-id/9f8e9b5a3352478d4cf7d6c0a5dd7e82496be= 4b6.camel@j-davis.com With #1, you can provide control over the search order to find the symbol you want. Granted, if you want to specify that different collations look in different libraries for the same version, then it won't work, because the search order is global -- is that what you're worried about? If so, I think we need to compare it against the downsides of #2-4, which in my opinion are more serious. The first thing to sort out with options #2-4 is: what about minor versions? V7 took the approach that only the major version matters. That means that if you want to select a specific minor version, then you are out of luck, because only one major at a time can be loaded, globally. But paying attention to minor versions seems like a mess -- we'd need even more magical fallbacks that try later minor versions or something. Second, there is weirdness in the common case that a collation version doesn't change between versions. Let's say you have a collation "mycoll" with locale "en_US" and it's pointed at built-in library version 64, with collation version 153.97. GUC default_icu_library_version is set to 63. Then you upgrade the system and ICU gets updated from 64 -> 65. Now, it can't find version 64 to load, so it falls back to 63 (which has the wrong version 153.88), even though 65 is just fine because it still offers that locale with version 153.97. (A similar problem exists when you remove a version of ICU from icu_library_path, and another version suffices for all of your collations.) Thirdly, as I said earlier, it's just hard on the user to try to sort out two different versions modeled in the database. Understanding encodings and collations are hard enough, and then we introduce *two* versions on top of that. Fourth, I don't see what the point of ucol_getVersion() is in schemes #2-4. All it does is control a WARNING, because throwing an error (at least by default) would be too harsh, given that users have lived with these risks for so long. But if all it does is throw a warning, what's the point in modeling it in the catalog as though it's the most important version? Ultimately, I think collation version (as reported by ucol_getVersion()) is the most accurate and least-surprising way to match a library-provided collation with the collation in the catalog. And it seems like we'd be using it in exactly the way the ICU maintainers intend it to be used. Of course, I cast my vote for #1 before I discovered this ICU bug here:=C2=A0 https://www.postgresql.org/message-id/0f7922d4f411376f420ec9139febeae4cdc74= 8a6.camel@j-davis.com That injects some doubt, to be sure. If I were to try to solve the problems with #2-4, one approach might be to treat the built-in ICU version differently from the ones in icu_library_path. Not quite sure, I'd have to think more. But as of now, I'd still lean toward #1 until a better option is presented. Regards, Jeff Davis