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 1oxMtc-00086E-2s for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Nov 2022 06:36:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oxMtb-0003A3-1J for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Nov 2022 06:36:39 +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 1oxMra-0007P8-5w for pgsql-hackers@lists.postgresql.org; Tue, 22 Nov 2022 06:34:34 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oxMrY-0006wl-1l for pgsql-hackers@postgresql.org; Tue, 22 Nov 2022 06:34:33 +0000 Received: by mail-pl1-x633.google.com with SMTP id y10so11530239plp.3 for ; Mon, 21 Nov 2022 22:34:31 -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=cn6CurzE6Z/Rnw4otqQblNbrT3zDrXVv5/XlKt5e/Cg=; b=0mrRYwggyMl8PPcwEUJ2jpgs9lf18xEWjemAFq7kVL8xCnsau9t45Gt3b0I7zNEyCU HtBGKT5r/Dt5b9dSfpuidqcIIFXYQDnEEP9hHR5SP/QIOHJkQlj3DxtB+i6hQNwa39S4 8tMrCgyTb3u6c5p6euKOde9t4Jn3DdU4O04axQ8GD7H77iqPwkJ56qVx5Tzu2F1/lY4B XFRoJY44ADtV7JSM9lqTqe7xq65JmtP+KjlGCCkR3UP1n/pZrxIt5IbSH92GUbD7uT1n Cstxn3krpCukeseYP5ZHK410CSbBiOiH9a4d0ksAsdBP6r5US3i8/TBMndqkbEAcEgyQ rSpg== 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=cn6CurzE6Z/Rnw4otqQblNbrT3zDrXVv5/XlKt5e/Cg=; b=iz+qZyc2CzyzYsaYgQFVVKAE3Xbz/yliTayZOGR8opWA8K94FN6GNo7pmGrwi35IAw 9r1YSR6OnTnU+yiyM5kB9oXa0hDYx034zhUcjtnxV2p+yf9s/4shYir5bJO7X1l4SDLf 6xrJfvRKg/sMd5KnEjola8LxC0jlBUHl7LanZV+EP3UeBsoWie6cVzvygyScGB6giUVt A3i6OwAJ1zbgvnn68+2kcEq6k6IkLKsWPBDPoIiy4qiaYI8yGJJLvxmhmSLNunlu1bt/ zonsiZG2dl6Xt5btOrALqfTL+8t3mjklZ++DcbSs/pq/9hNZNr5F8zhhR1QtsC+0Z7Lm UaLA== X-Gm-Message-State: ANoB5pl0FyJqpNnYOLoOMfpV6xKlUcjidc5+jotk+9ODyRSLJk2Y0ZLf O08TG1RX5qaqQ8d6HiZuNpSwng== X-Google-Smtp-Source: AA0mqf6Ui10RTuV/bB+xG0UwDHEG6MLV3gO8K+DZkS9xSW9ys03E9caCnILxL6f4FMcNEU/1vz4GtQ== X-Received: by 2002:a17:902:bc84:b0:17f:700a:2cd3 with SMTP id bb4-20020a170902bc8400b0017f700a2cd3mr3241738plb.36.1669098869861; Mon, 21 Nov 2022 22:34:29 -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 a81-20020a621a54000000b00574212609ddsm113902pfa.70.2022.11.21.22.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 22:34:29 -0800 (PST) Message-ID: <9f8e9b5a3352478d4cf7d6c0a5dd7e82496be4b6.camel@j-davis.com> Subject: Re: Collation version tracking for macOS From: Jeff Davis To: Thomas Munro Cc: Peter Eisentraut , Jeremy Schneider , Peter Geoghegan , "Finnerty, Jim" , "Nasby, Jim" , Tom Lane , pgsql-hackers Date: Mon, 21 Nov 2022 22:34:27 -0800 In-Reply-To: References: <398aabd1-ad95-ba2d-d70a-dd5d90bf6e07@enterprisedb.com> <606bd2baa6d65b38fee6eb23bba40c5da210255b.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 Sat, 2022-10-22 at 14:22 +1300, Thomas Munro wrote: > Problem 2: If ICU 67 ever decides to report a different version for > a > given collation (would it ever do that? I don't expect so, but ...), > we'd be unable to open the collation with the search-by-collversion > design, and potentially the database. What is a user supposed to do > then? Presumably our error/hint for that would be "please insert the > correct ICU library into drive A", but now there is no correct > library Let's say that Postgres is compiled against version 67.X, and the sysadmin upgrades the ICU package to 67.Y, which reports a different collation version for some locale. Your current patch makes this impossible for the administrator to fix, because there's no way to have two different libraries loaded with the same major version number, so it will always pick the compiled-in ICU. The user will be forced to accept the new version of the collation, see WARNINGs in their logs, and possibly corrupt their indexes. Search-by-collversion would still be frustrating for the admin, but at least it would be possible to fix by compiling their own 67.X and asking Postgres to search that library, too. We could make it slightly more friendly by having an error that reports the libraries searched and the collation versions found, if none of the versions match. We can have a GUC that controls whether a failure to find the right version is a WARNING or an ERROR. On Sat, 2022-11-19 at 07:38 +1300, Thomas Munro wrote: > > =C2=A0 * We'll need some clearer instructions on how to build/install > > extra > > ICU versions that might not be provided by the distribution > > packaging. > > For instance, I got a cryptic error until I used --enable-rpath, > > which > > might not be obvious to all users. >=20 > Suggestions welcome.=C2=A0 No docs at all yet... I tried to write up some docs. It's hard to explain why we are exposing to the user the collation version and the library version in these different ways, and what effects they have. The current patch feels like it hasn't decided whether the collation version is ucol_getVersion() (collversion) or u_getVersion() (library version). The collversion is more prominent in the UI (with its own syntax), yet it's just a cross-check for whether to issue a WARNING or not; while the library version is hidden in the locale field and it actually decides which symbol is called. >=20 >=20 > Yeah.=C2=A0 I just don't like the way it *appears* to be doing something > clever, but > it doesn't solve any fundamental problem at all because the > collversion > information is under human control and so it's really doing something > stupid. I assume by "human control" you mean "ALTER COLLATION ... REFRESH VERSION". I agree that relying on the admin's declaration is dubious, especially when we provide no good advice on how to actually do that safely. But I don't see what using the library version instead buys us here, except that library version is part of the LOCALE, and there's no ALTER command for that. You could just as easily deprecate/eliminate the ALTER COLLATION REFRESH VERSION, and then say that the collversion is out of human control, too. By introducing multiple libraries, I think we need to change that syntax anyway, to be something like: ALTER COLLATION ... SET VERSION TO '...' or even: ALTER COLLATION ... FORCE VERSION TO '...' > Hence desire to build something that at least admits that it's > primitive and > just gives you some controls, in a first version. Using either the library version or the collation version seems reasonably simple to me. But from a documentation and usability standpoint, the way they are currently mixed seems confusing. --=20 Jeff Davis PostgreSQL Contributor Team - AWS