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 1nzSMV-0002kY-FE for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jun 2022 00:18:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nzSMU-0005vM-7P for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jun 2022 00:18:50 +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 1nzSMT-0005vB-SQ for pgsql-hackers@lists.postgresql.org; Fri, 10 Jun 2022 00:18:49 +0000 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nzSMQ-0007Ol-J5 for pgsql-hackers@postgresql.org; Fri, 10 Jun 2022 00:18:49 +0000 Received: by mail-il1-x136.google.com with SMTP id z11so1074692ilq.6 for ; Thu, 09 Jun 2022 17:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PFT1QsJmbAI9vW+vRk+xLkSU2xhSZEZaxa/QvWsyjpQ=; b=Oge0K6jiR00ODQB/kLzFxz2gdqJI0XQSM+ia6y+EAMsH+OiTOnsrJFax6RzbzhVKGq RPtK6w8E5g32Lsb+IYgOlUYvTv1tT52IzFXGFsW5jbCGN5TsBmFCTcCW5SBhe3g5/gBu 1sQZSEe/fSf6B1vdR65JswO4bh/mmDnyM/BFYThgaej1qyTm6H5Sc+zvk1yvFSevG2B5 cT/kiei40L+7BgLToyerySX76nn34LSUQzMi9a8dwSsWFYmqIHx3BPNIrpyLA1h1o4Pj /Dh4BvWF2TbSmSsbed3uAFb/VvxZvH2/qs2t5o0+svXk8+jGoXt2ZQ542qq7rNv8rfXH Mebw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PFT1QsJmbAI9vW+vRk+xLkSU2xhSZEZaxa/QvWsyjpQ=; b=eIB+Sh3TmHdkPsLQC9E6CVPJro/6wI4W5VhywxV5CT4FQUVGbIROkOHO95bPGnT2Jm 3Y1Gpnxmw3QZWyMWSWlj7fMO31XwsFmXtfs0snScmpeS9LOby0wLP4sN2rEKlKvLlev0 MU0IAwcAhcHPXDOHsBc+zjhwilGvq+Hna/LAUXPjAZcedkKFqW0lPrZqc00VORugHhRo +oeIfgThjYBTdtK8Y4x0XtB5TeY9kH+Ok0g/OZ40AMc8mJBncv8OPpgeLqEqtz0aHgqr YR297pgWsaKOE7q59XKovro1ZncYU12ZaUQNj0ZZ7kwOcyVkbdCm7USTzTq3P76DBI9S AIXg== X-Gm-Message-State: AOAM533gIZ2Dgoq2wmK+GMa+cPlhBBt6cdkYfWYcS7hmqXUPKjV9jlkw YO0hTX1HPxNSMeOpRxHlYckvUwQ7Es56Wf96G8E= X-Google-Smtp-Source: ABdhPJygNMOYmdakEtEdtuXpxX+xrcwQnBuaMvysKTXFCMqd0kuW+68ZtI+kx4l+Y75Vi1phwWL7fcMYhYYdYty4qgA= X-Received: by 2002:a05:6e02:b2c:b0:2d1:ba4d:c240 with SMTP id e12-20020a056e020b2c00b002d1ba4dc240mr24423386ilu.273.1654820324697; Thu, 09 Jun 2022 17:18:44 -0700 (PDT) MIME-Version: 1.0 References: <381977b1-0898-cb6f-a427-3b5d873e81bd@enterprisedb.com> <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> In-Reply-To: From: Thomas Munro Date: Fri, 10 Jun 2022 12:18:06 +1200 Message-ID: Subject: Re: Collation version tracking for macOS To: Peter Geoghegan Cc: "Finnerty, Jim" , "Nasby, Jim" , Tom Lane , Jeremy Schneider , Peter Eisentraut , pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jun 10, 2022 at 10:29 AM Peter Geoghegan wrote: > On Thu, Jun 9, 2022 at 2:20 PM Finnerty, Jim wrote: > > For example, an alternate syntax might be: > > > > create collation icu63."en-US-x-icu" (provider = icu, locale = 'en-US@colVersion=63'); > > Why would a user want to specify an ICU version in DDL? Wouldn't that > break in the event of a dump and reload of the database, for example? > It also strikes me as being inconsistent with the general philosophy > for ICU and the broader BCP45 IETF standard, which is "interpret the > locale string to the best of our ability, never throw an error". > > Your proposed syntax already "works" today! You just need to create a > schema called icu63 -- then the command executes successfully (for > certain values of successfully). Jim was proposing the @colVersion=63 part, but the schema part came from my example upthread. That was from a real transcript, and I included that because the way I've been thinking of this so far has distinct collation OIDs for the "same" collation from different ICU libraries, and yet I want them to have the same collname. That is, I don't want (say) "en-US-x-icu63" and "en-US-x-icu71"... I thought it'd be nice to keep using "en-US-x-icu" as we do today, so if there are two of them they'd *have* to be in different schemas. That has the nice property that you can use the search_path to avoid mentioning it. But I'm not at all wedded to that idea, or any other ideas in this thread, just trying stuff out... However, since you mentioned that a simple REINDEX would get you from one library version to another, I think we're making some completely different assumptions somewhere along the line, and I don't get your idea yet. It sounds like you don't want two different collation OIDs in that case? The (vastly too) simplistic way I was thinking of it, if you have a column with an ICU 63 collation, to switch to ICU 67 you first do some DDL to add ICU 67 to your system and import 67's collations (creating new collation OIDs), and then eg ALTER TABLE foo ALTER COLUMN bar TYPE text COLLATE icu67."en-US-x-icu", which will rebuild your indexes. That's a big job, and doesn't address how you switch the database default collation. None of that is very satisfying, much more thought needed, but it falls out of the decision to have distinct icu63."en-US-x-icu" and icu67."en-US-x-icu". You seem to have some other idea in mind where the system only knows about one "en-US-x-icu", but somehow, somewhere else (where?), keeps track of which indexes were built with ICU 63 and which with ICU 67, which I don't yet grok. Or did I misunderstand?