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 1nygv1-0002cd-8e for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jun 2022 21:39:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nygu1-0001s4-Ma for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jun 2022 21:38:17 +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 1nygu1-0001r8-D6 for pgsql-hackers@lists.postgresql.org; Tue, 07 Jun 2022 21:38:17 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nygty-0006F3-M9 for pgsql-hackers@postgresql.org; Tue, 07 Jun 2022 21:38:16 +0000 Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1nygtn-000jrE-2D; Tue, 07 Jun 2022 17:38:03 -0400 Date: Tue, 7 Jun 2022 17:38:03 -0400 From: Bruce Momjian To: Tom Lane Cc: Thomas Munro , Rod Taylor , Jim Nasby , Jeremy Schneider , Peter Eisentraut , pgsql-hackers Subject: Re: Collation version tracking for macOS Message-ID: References: <231072.1654273317@sss.pgh.pa.us> <1874de62-6bec-4bc1-1d14-0a2730b125da@ardentperf.com> <366234.1654289888@sss.pgh.pa.us> <0867fe37-abbd-77ba-aafc-572074978bb0@amazon.com> <976279.1654561524@sss.pgh.pa.us> <1310017.1654631012@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1310017.1654631012@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jun 7, 2022 at 03:43:32PM -0400, Tom Lane wrote: > Thomas Munro writes: > > On Wed, Jun 8, 2022 at 3:58 AM Rod Taylor wrote: > >> Is this more involved than creating a list of all valid Unicode characters (~144 thousand), sorting them, then running crc32 over the sorted order to create the "version" for the library/collation pair? Far from free but few databases use more than a couple different collations. > > > Collation rules have multiple levels and all kinds of quirks, so that > > won't work. > > Yeah, and it's exactly at the level of quirks that things are likely > to change. Nobody's going to suddenly start sorting B before A. > They might, say, change their minds about where the digram "cz" > sorts relative to single letters, in languages where special rules > for that are a thing. > > The idea of fingerprinting a collation's behavior is interesting, > but I've got doubts about whether we can make a sufficiently thorough > fingerprint. Rather than trying to figure out if the collations changed, have we ever considered checking if index additions and lookups don't match the OS collation and reporting these errors somehow? -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Indecision is a decision. Inaction is an action. Mark Batterson