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 1n6uEZ-0008Tk-9w for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 12:57:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n6uEY-0001Q3-51 for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 12:57:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n6uEX-0001Pu-QU for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 12:57:09 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n6uEU-0004PG-1s for pgsql-hackers@postgresql.org; Mon, 10 Jan 2022 12:57:08 +0000 Received: by mail-pj1-x1035.google.com with SMTP id lr15-20020a17090b4b8f00b001b19671cbebso15827004pjb.1 for ; Mon, 10 Jan 2022 04:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=2HRwnxAQH6VAZaqVzHQGsLQ5972rueqYgJ/Aa1bGfgM=; b=R+41oeodLthIXd0dHULMUMHcMt+hV1Y1Qb7b//bPgtNtsAWicspgsjhIjFZOt+UPgh IUXST3oLrgIEULfxxmepRit+J4xKlTSf2LPGwkYZkYKE8zIf2w/eb6vF+k2FS4UXYwt/ oBHYsMNRy8gSSdyj5OXjbMnSAHo76tPj7NgwnmtKE1E96xihKmqLOT18VUKtpbcZ7n7u fAfyxwTER/d3YN4lEnX/3fLOdIaCuDQVUn7KzttMi8vhm2DqmiqPtu2uR4xGWFNwvdnm eCYXYFTHxjQBSaEh/MlqtqthjhOoXSNonybSo3viwgP0d1H1V+MbEInLc/g/fY6oF92j Vd3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2HRwnxAQH6VAZaqVzHQGsLQ5972rueqYgJ/Aa1bGfgM=; b=PVCwW5CBT5s8wQBteGib7zxkM7G785iWy4ADqC1ygUWuOTJFY6P4aIDpyHEcmEE1Of 5+a5C+5bMK0JPSBJLWxzfUxxo6tf47VR/7eN8meGUp+B/9TnRektuNjRNSpkrHLtdFbq hrqjYCg32HoRxpZ/fbFkzMFWFsxq5eklBkHbGLDcKKBupIrE4oolq8oMZVKkLVD3K8HA N+As6YOsvz/OpS8HjSnxkU9RD1GqQnc2FGTQNsO+42eM/D3RcZkEWOYsOx2nwTJO5ubA yaasm7OpWDxhG1jyNYnQoC7rzcYgLRd5LHElqm44AsUD0Ij/kVEN0WndJKkwYcBQkeNh YbfA== X-Gm-Message-State: AOAM531on4DJimMlexqE47SdWjF7mJmLjGB3r6vAuXK/xKuPthBv0Ezz /rzu2zy/SsQl1YpSuba/5Fw= X-Google-Smtp-Source: ABdhPJySLTPkGiLz4NJc/gu+xtd3w/fSz0r+SE/QghN0aeDTrR2vj6FCTYisd8fG9GBny+08r+XJRw== X-Received: by 2002:a63:7f17:: with SMTP id a23mr7640133pgd.203.1641819424783; Mon, 10 Jan 2022 04:57:04 -0800 (PST) Received: from jrouhaud (1-171-174-202.dynamic-ip.hinet.net. [1.171.174.202]) by smtp.gmail.com with ESMTPSA id z12sm5382587pga.28.2022.01.10.04.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 04:57:03 -0800 (PST) Date: Mon, 10 Jan 2022 20:56:56 +0800 From: Julien Rouhaud To: Daniel Verite Cc: Peter Eisentraut , pgsql-hackers Subject: Re: ICU for global collation Message-ID: References: <525ef44f-52bf-505f-a491-07835d039424@enterprisedb.com> <809c0fba-b0e6-44bf-b110-0886cb462aab@manitou-mail.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <809c0fba-b0e6-44bf-b110-0886cb462aab@manitou-mail.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 10, 2022 at 12:49:07PM +0100, Daniel Verite wrote: > > The "daticucol" column also suggests that we don't expect to add > other collation providers in the future. Maybe a pair of columns like > (datcollprovider, datcolllocale) would be more future-proof, > or a (datcollprovider, datcolllocale, datcollisdeterministic) > triplet if non-deterministic collations are allowed. I'm not sure about the non-deterministic default collation given the current restrictions with it, but the extra column seems like a good idea. It would require a bit more thinking, as we would need a second collation column in pg_database for any default provider that's not libc. > Also, pg_collation has "collversion" to detect a mismatch between > the ICU runtime and existing indexes. I don't see that field > for the db-wide ICU collation, so maybe we currently miss the capability > to detect the mismatch for the db-wide collation? I don't think that storing a version there will really help. There's no guarantee that any object has been created with the version of the collation that was installed when the database was created. And we would still need to store a version with each underlying object anyway, as rebuilding all broken dependencies can last for a long time, including a server restart. > The lack of these fields overall suggest the idea that when CREATE > DATABASE is called with a global ICU collation, what if it somehow > inserted the collation into pg_collation in the new database? > Then pg_database would just store the collation oid and no other > collation-related field would need to be added into it, now > or in the future. I don't think it would be doable given the single-database-per-backend restriction.