Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rZcrb-005Y4i-Gs for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Feb 2024 20:25:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rZcra-00Ct5d-DQ for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Feb 2024 20:25:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rZcrZ-00Ct5V-WD for pgsql-hackers@lists.postgresql.org; Mon, 12 Feb 2024 20:25:14 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rZcrX-006QBz-H1 for pgsql-hackers@postgresql.org; Mon, 12 Feb 2024 20:25:12 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1d8ef977f1eso26226455ad.0 for ; Mon, 12 Feb 2024 12:25:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1707769510; x=1708374310; darn=postgresql.org; 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=qAA1dt/AFxwewvuoUiH25qSxy3geRlD+vfKUkWqmR90=; b=XzNFeGoRghlo7wBETBJwM/eH65e5jmDDrEIT5Zy6AJ9q0PPXz+zGySfOyjCX9wsozA sU0dy/AQ+TnViLtkOrDRikaCWHUTfYPILzCWyyrLbkVf/s0UAb+jXXwcOC3QRtQQL9lh /w6dWOHXQcAHIn4SEVgQ+rpay0Cd3DbsooheNGQKyqII4U3SxRZzCaGVwUGAZED/nrXe Y5D7I9vT575hmSOtOnbONx2yMRZocOzS/BYt7PnYKV34XSsT+bp3CobCJSeXkZEWCZvd jn9R+AOYn6Ic/NpBM7LZtF68Sxu+wS6bUSqF+nL154OGnXv5LkcKLFWTGRcbgz/JnO+m TRNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707769510; x=1708374310; 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=qAA1dt/AFxwewvuoUiH25qSxy3geRlD+vfKUkWqmR90=; b=ckSPltgmmfCKuSMcYdpCpmPS58s+k3TWNr2JMi1YOguH25juT6iglorZIGqDOBqckG FWzMSyYCTi3jG0gqp9he4tnsTHs124cCj/EbHlAsekFRm6WQ0A9uYS65n6duHZ5voHV+ Oz5yUgCGCKv+ys5rp+ylhEJ5yaV0SvGIWi+u5iB20PKg4Jwqsx3WGOfkeQ0T3DTmea93 JjA7HDDPCtR1D+wPy7XBN+6Bg84fJ7ZPbQz3pVkvfZuHCv6ZJx6Y+NXd/tEtZQEG0mrh S0NahMBPyre/PujuLGmVeRGPKUs8hXzWVzc6+jz3FufEtM/HJ2pdTwzu2lZE3ErRckjv rqDQ== X-Gm-Message-State: AOJu0YzPWqcBTsu/WCwuITtMtQswpplHPBMn5RNSw5+u+O6I+mJ6IDbU 0hgkL29Wb228H5gT4qlFP/Imwdbl1iks4tcmsafCLAqbFeTZ61WsQNUOesZ/flaz5F2bM9yuGw8 L3Q== X-Google-Smtp-Source: AGHT+IEMeRagTWFW2e4oav9+rOkT7DKimDQIUjjkMyWZeVV1NyUgwt0t3TEmmG7zzteCIsRpxpFnAA== X-Received: by 2002:a17:902:6b46:b0:1d9:6091:6f3b with SMTP id g6-20020a1709026b4600b001d960916f3bmr7620531plt.47.1707769510565; Mon, 12 Feb 2024 12:25:10 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVp93JMEdjRgm8KUCDsGdCjBysX6fnAby7oulaiMBni/652KyKJeTI2CUifhNI42FvVUTCW95LmlBWqdnIj/ckaYs+Jh96dJ63S1FsmXW9jzEZXobpD5yVbi2uwPRRSTPM+7cc7fVyXF4XKDJmu3gEz52p1H69yKQsd1E/h/qqnCjpbBDAXkW70feqzEEJy54sSUScR+H0FXzL5XBxeGWqJTj2Xg7YHVw6uLdItcw7yBi7KBGKHhmQ9tJFgG5Pk3Q2kjTWj6EAmY1EbvbSD9gsL1FU02q94xn5O8jCOWcI2Z3vycZCR+3k= Received: from [172.18.10.46] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id f6-20020a17090274c600b001db28ae5d81sm725051plt.159.2024.02.12.12.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 12:25:10 -0800 (PST) Message-ID: <378df4dd8eac41fcfe78a552e5e08ebb7c041455.camel@j-davis.com> Subject: Re: Collation version tracking for macOS From: Jeff Davis To: Robert Haas Cc: vignesh C , Thomas Munro , Joe Conway , Peter Eisentraut , Jeremy Schneider , Peter Geoghegan , "Nasby, Jim" , Tom Lane , pgsql-hackers Date: Mon, 12 Feb 2024 12:25:09 -0800 In-Reply-To: References: <398aabd1-ad95-ba2d-d70a-dd5d90bf6e07@enterprisedb.com> <606bd2baa6d65b38fee6eb23bba40c5da210255b.camel@j-davis.com> <9f8e9b5a3352478d4cf7d6c0a5dd7e82496be4b6.camel@j-davis.com> <346f836208a39009c1998ed5a41c7f1a0be36911.camel@j-davis.com> <776e9ddb-a0e6-3f29-9368-a194be30d1a6@joeconway.com> <6f4a8c01a5cb1edf3a07d204c371fbddaef252f9.camel@j-davis.com> <69ce2595450464ff1bcd8da1d5b0613b1d504b22.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 2024-02-11 at 22:04 +0530, Robert Haas wrote: > 1. Here's what we think your OS package manager is probably going to > do. > 2. That's going to interact with PostgreSQL in this way that I will > now describe. > 3. See, that sucks, because of the stuff I said above about needing > stable collations! > 4. But if you installed this module instead, then you could prevent > the things I said under #2 from happening. > 5. Instead, you'd get this other behavior, which would make you > happy. I like that framing, thank you. I'll try to come up with something there. > I feel like I can almost piece together in my head how this is > supposed to work -- I think it's like "we expect the OS package > manager to drop all the ICU versions in the same directory via side > by > side installs, and that works well for other programs because ... for > some mysterious reason they can latch onto the specific version they > were linked against ... but we can't or don't do that because ... I > guess we're dumber than those other pieces of software or > something???? ...=C2=A0 Postgres can and does latch on to the version of ICU it was compiled against. It's a normal shared library dependency. The problem is that databases -- and the file structures -- outlive a particular version of Postgres. So if Postgres 16 is compiled against ICU X and Postgres 17 is compiled against ICU Y, how do you upgrade from 16 to 17? Postgres 17 will try to access the old file structures using ICU Y, and they'll be corrupt. What we want is the file structures that depend on ICU X to continue to find ICU X even after you upgrade to Postgres 17, yet allow new structures to be created using ICU Y. In other words, "multi-lib", meaning that the same Postgres binary is linking to multiple versions of ICU and the different versions for different structures. That would allow users to recreate one index at a time to use ICU Y, until nothing depends on ICU X any longer. I should say this is not an easy process even if something like icu_multilib is available. We don't have all of the information needed in the catalog to track which structures depend on which versions of a collation library, collation library version is itself not easy to define, and it still involves rebuilding (or at least re-validating) a lot of structures. This is a "make hard things possible" tool, and I suspect only a handful of users would use it successfully to migrate to new ICU versions. More simply, some users might just want to lock down the version of ICU to X, and just use that forever until they have a reason to change it. icu_multilib can also facilitate that, though it's still not trivial. > "icu_multilib must be loaded via shared_preload_libraries. > icu_multilib ignores any ICU library with a major version greater > than > that with which PostgreSQL was built." >=20 > It's not clear from reading this whether the second sentence here is > a > regrettable implementation restriction or design behavior. If it's > design behavior, what's the point of it? That restriction came from Thomas's (uncommitted) work on the same problem. I believe the reasoning was that we don't know whether future versions of ICU might break something that we're doing, though perhaps there's a better way. Regards, Jeff Davis