From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Tatsuo Ishii <ishii@sraoss.co.jp>
Cc: chuxiongzhong@gmail.com
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Proposal to Compile a 256-Byte Identifier Length Version Alongside the Current 64-Byte Version
Date: Tue, 10 Oct 2023 10:37:07 -0400
Message-ID: <324703.1696948627@sss.pgh.pa.us> (raw)
In-Reply-To: <deed04f45d29d891280a0c95845e2486b36b471f.camel@cybertec.at>
References: <CAKabb9VWBgeLfVxq=SqfW72W8wP5c3-nQBexowubxahVPpLK3Q@mail.gmail.com>
<20231010.155317.1680295102845562806.t-ishii@sranhm.sra.co.jp>
<deed04f45d29d891280a0c95845e2486b36b471f.camel@cybertec.at>
Laurenz Albe <laurenz.albe@cybertec.at> 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 the
> 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%3DTgNmEB2QP9wiF6DTUbBuMXrQ%4...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, ishii@sraoss.co.jp, chuxiongzhong@gmail.com
Subject: Re: Proposal to Compile a 256-Byte Identifier Length Version Alongside the Current 64-Byte Version
In-Reply-To: <324703.1696948627@sss.pgh.pa.us>
References: <CAKabb9VWBgeLfVxq=SqfW72W8wP5c3-nQBexowubxahVPpLK3Q@mail.gmail.com> <20231010.155317.1680295102845562806.t-ishii@sranhm.sra.co.jp> <deed04f45d29d891280a0c95845e2486b36b471f.camel@cybertec.at> <324703.1696948627@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox