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 1pxGEp-00010I-Lz for pgsql-bugs@arkaria.postgresql.org; Fri, 12 May 2023 00:02:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pxGEm-0002qX-Rk for pgsql-bugs@arkaria.postgresql.org; Fri, 12 May 2023 00:02:20 +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 1pxGEm-0002qO-Jk for pgsql-bugs@lists.postgresql.org; Fri, 12 May 2023 00:02:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pxGEj-0024nE-NP for pgsql-bugs@postgresql.org; Fri, 12 May 2023 00:02:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 34C02E0V1209304; Thu, 11 May 2023 20:02:14 -0400 From: Tom Lane To: Jeff Davis cc: pgsql-bugs@postgresql.org Subject: Re: Possible to create a hidden collation In-reply-to: <051c9395cf880307865ee8b17acdbf7f838c1e39.camel@j-davis.com> References: <051c9395cf880307865ee8b17acdbf7f838c1e39.camel@j-davis.com> Comments: In-reply-to Jeff Davis message dated "Thu, 11 May 2023 13:45:38 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1209302.1683849734.1@sss.pgh.pa.us> Date: Thu, 11 May 2023 20:02:14 -0400 Message-ID: <1209303.1683849734@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis writes: > There's no reason to create user defined collations with collencoding=- > 1. As far as I can tell, collencoding is only there to hide built-in > collations (inherited from template0) that aren't compatible with the > current database encoding. So we can just always create user-defined > collations with collencoding=GetDatabaseEncoding(). What happens if somebody makes a user-defined collation in template0 and then clones that into a different encoding? I guess the user-defined collation would then be hidden/inaccessible in the clone DB, so maybe it's fine. regards, tom lane