pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David HJ <chuxiongzhong@gmail.com>
To: 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 08:22:55 +0200
Message-ID: <fa06c50f22bee0968e411800a16ae2d8a0d79f41.camel@cybertec.at> (raw)
In-Reply-To: <CAKabb9VWBgeLfVxq=SqfW72W8wP5c3-nQBexowubxahVPpLK3Q@mail.gmail.com>
References: <CAKabb9VWBgeLfVxq=SqfW72W8wP5c3-nQBexowubxahVPpLK3Q@mail.gmail.com>

On Tue, 2023-10-10 at 11:49 +0800, David HJ wrote:
> I am writing to propose an alternative compilation of PostgreSQL that allows
> for a 256-byte identifier length limit, alongside the existing 64-byte version.
> 
> Problem:
> The current limit of 63 bytes can be quite restrictive, especially for databases
> that use multi-byte character sets like UTF-8. In such cases, a Chinese character
> takes up 3 bytes, limiting the name to just 21 characters.
> 
> Use-Case:
> In specific use-cases, table names like
> "能源消耗统计_全球主要国家石油与天然气使用量_年度碳排放与可再生能源比例表" and
> "气候变化研究_全球主要地区极端天气事件频率_年度灾害损失与应对措施表" can far exceed
> the current limit.

I have little understanding for people who name their tables
energy_consumption_statistics_oil_and_natural_gas_usage_in_major_countries_around_the_world_annual_carbon_emissions_and_renewable_energy_ratio_table.
The table could just as well be named "能源统计排放比".  The exact description could
go in the table comment.  Apart from that, it is a good idea to use table names
that are standard SQL identifiers, so that you don't have to double quote them
all the time.

Anyway, you are not the first person to hit the limit, so there is clearly a
pain that some people feel.

> Proposed Solution:
> I propose that we offer an alternative compilation of PostgreSQL that increases
> the NAMEDATALEN constant to allow for 256-byte identifiers. This would be
> particularly useful for databases that make extensive use of multi-byte character
> sets like UTF-8.

Wouldn't it be a good solution if we promote the #define to a configure option,
like "./configure --identifier-length-limit=256"?

Yours,
Laurenz Albe





view thread (8+ messages)  latest in thread

Message-ID: <fa06c50f22bee0968e411800a16ae2d8a0d79f41.camel@cybertec.at>
Permalink:  ../fa06c50f22bee0968e411800a16ae2d8a0d79f41.camel@cybertec.at/
Also on:    postgresql.org/message-id/fa06c50f22bee0968e411800a16ae2d8a0d79f41.camel@cybertec.at

 · 

reply

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: laurenz.albe@cybertec.at, chuxiongzhong@gmail.com
  Subject: Re: Proposal to Compile a 256-Byte Identifier Length Version Alongside the Current 64-Byte Version
  In-Reply-To: <fa06c50f22bee0968e411800a16ae2d8a0d79f41.camel@cybertec.at>
  References: <CAKabb9VWBgeLfVxq=SqfW72W8wP5c3-nQBexowubxahVPpLK3Q@mail.gmail.com> <fa06c50f22bee0968e411800a16ae2d8a0d79f41.camel@cybertec.at>

* 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