Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqDrH-008hBf-SL for pgsql-general@arkaria.postgresql.org; Tue, 10 Oct 2023 14:37:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qqDrF-008Nd3-GT for pgsql-general@arkaria.postgresql.org; Tue, 10 Oct 2023 14:37:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqDrF-008NcG-5N for pgsql-general@lists.postgresql.org; Tue, 10 Oct 2023 14:37:14 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qqDrD-001Inj-6c for pgsql-general@lists.postgresql.org; Tue, 10 Oct 2023 14:37:13 +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 39AEb7Ud324704; Tue, 10 Oct 2023 10:37:07 -0400 From: Tom Lane To: Laurenz Albe cc: Tatsuo Ishii , chuxiongzhong@gmail.com, pgsql-general@lists.postgresql.org Subject: Re: Proposal to Compile a 256-Byte Identifier Length Version Alongside the Current 64-Byte Version In-reply-to: References: <20231010.155317.1680295102845562806.t-ishii@sranhm.sra.co.jp> Comments: In-reply-to Laurenz Albe message dated "Tue, 10 Oct 2023 11:26:12 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <324702.1696948627.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 10 Oct 2023 10:37:07 -0400 Message-ID: <324703.1696948627@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > On Tue, 2023-10-10 at 15:53 +0900, Tatsuo Ishii wrote: >> Another solution would be, letting the meaning of NAMEDATALEN to be >> number of *characters*, not the number of bytes. This way, you can use >> up to 64 UTF-8 characters. In my understanding MySQL already does this >> way. I know this requires non trivial code modifications to PostgreSQL >> but would be better than to make binaries with random NAMEDATALEN >> values. > Since "name" is a fixed-length data type, that would require the stored > size to increase to accomodate the extra bytes. Wouldn't that change th= e > storage format and break pg_upgrade? Yeah, the real reason this is unlikely to happen is precisely that "name" is fixed-length. Increasing the standard NAMEDATALEN by 4x, or even 2x, has been proposed and rejected many times before because of the bloat it would cause in places like pg_attribute, pg_proc, in-memory tuple descriptors, etc. The real way forward IMO is to find a way to make "name" variable-length, thus both satisfying people who need a few long names and reducing overhead for everybody. This is difficult to do without breaking mountains of backend code, but there's been some discussions about ways to accomplish that. The most recent thread I could find is https://www.postgresql.org/message-id/flat/CALSd-crdmj9PGdvdioU%3Da5W7P%3D= TgNmEB2QP9wiF6DTUbBuMXrQ%40mail.gmail.com regards, tom lane