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 1qq692-0089Y1-GD for pgsql-general@arkaria.postgresql.org; Tue, 10 Oct 2023 06:23:04 +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 1qq68y-004a1R-Rc for pgsql-general@arkaria.postgresql.org; Tue, 10 Oct 2023 06:23:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qq68y-004a1I-63 for pgsql-general@lists.postgresql.org; Tue, 10 Oct 2023 06:23:01 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qq68w-000uDC-IH for pgsql-general@lists.postgresql.org; Tue, 10 Oct 2023 06:22:59 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-538e8eca9c1so9181610a12.3 for ; Mon, 09 Oct 2023 23:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1696918976; x=1697523776; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=oagVOdXFMveEBJIeeJ7t8oIKjOwYXSP0kVTwNJh/C4A=; b=Z4VmFdTrZEUXMndrTIiwzYRt8qpFEvGQ/EOV5jodC5HnLHPq+OOw9qkLVZYeUiInbj Q7/QLVsOP+uZ38q6DoEwaSfsSXCwXCgCU0G/7vRXQq2J8LdYyKmNkAGVVp46h8Pe4sSG iQ9TV29ywew+C0f2GaMTDH/alRM0Sj4y5phr4IgKLu7A2dxQ6SOLU6ciB8z7zB+h8b28 W+bq1hp7xaMVbjLD9J3NtWXEAqwiPzJiz8NuhDEdd8+6Iqj503mQuvVIJ2+l0xAvtqLa scMRHXLy1o2sB7s3KywCUSai53hfdE5MMzritTC3lqSC9ayyK8H0763COtKnIFm5GJ2u uqdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696918976; x=1697523776; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oagVOdXFMveEBJIeeJ7t8oIKjOwYXSP0kVTwNJh/C4A=; b=Hfch6OQaYmeLKNla5U3TOtCgMLFzLvWvzeBe0f+Q5ff9+pYVPighOxEa7/j3tqoBDD +OeERvlxkVy2SlkxX9x9JUTbOzR4zzTb+ZRoGRB9TI17hxFo2y+TjdYS3+4eQGyWAGvt XatWk9AsUt1nLi8S29ZDWewMrKYjXeZaXoKB01NgqW8JPhaeqPtJMOpxlJW2cyRIrX7/ Ii3n2SjkwdzPUBj7SWnhuWg7o2P0WqEy/Ur0kWvb27lXEhPOlsK6nHfqADVGQ+GFIxMp tOlHIBeykXeHGMuGTUhUneW4uVPTzxhpYjY491plEWCLRVMxvJFce5bwiqjLWQkCydCX mFtg== X-Gm-Message-State: AOJu0YynB5Rv2IH21tR07zey3Ec9G4MfNx2c3NmzEITorvBf85LGvDtq 9g9eICd3XSFjOxAHRzY9N0v1ow== X-Google-Smtp-Source: AGHT+IFGmCyLuFp6rBJAGgwk8kKocnMsR8khT30IVQGiCXp9IUyHlZnPtUVOEgI2T6W4NwUhluiTFw== X-Received: by 2002:a17:906:1d:b0:9b2:be12:d9bd with SMTP id 29-20020a170906001d00b009b2be12d9bdmr13647060eja.77.1696918976065; Mon, 09 Oct 2023 23:22:56 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:b717:871:7e70:f616:90ba]) by smtp.gmail.com with ESMTPSA id h17-20020a1709063c1100b009b94a8150d8sm7976424ejg.199.2023.10.09.23.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 23:22:55 -0700 (PDT) Message-ID: Subject: Re: Proposal to Compile a 256-Byte Identifier Length Version Alongside the Current 64-Byte Version From: Laurenz Albe To: David HJ , pgsql-general@lists.postgresql.org Date: Tue, 10 Oct 2023 08:22:55 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2023-10-10 at 11:49 +0800, David HJ wrote: > I am writing to propose an alternative compilation of PostgreSQL that all= ows > for a 256-byte identifier length limit, alongside the existing 64-byte ve= rsion. >=20 > Problem: > The current limit of 63 bytes can be quite restrictive, especially for da= tabases > that use multi-byte character sets like UTF-8. In such cases, a Chinese c= haracter > takes up 3 bytes, limiting the name to just 21 characters. >=20 > Use-Case: > In specific use-cases, table names like > "=E8=83=BD=E6=BA=90=E6=B6=88=E8=80=97=E7=BB=9F=E8=AE=A1_=E5=85=A8=E7=90= =83=E4=B8=BB=E8=A6=81=E5=9B=BD=E5=AE=B6=E7=9F=B3=E6=B2=B9=E4=B8=8E=E5=A4=A9= =E7=84=B6=E6=B0=94=E4=BD=BF=E7=94=A8=E9=87=8F_=E5=B9=B4=E5=BA=A6=E7=A2=B3= =E6=8E=92=E6=94=BE=E4=B8=8E=E5=8F=AF=E5=86=8D=E7=94=9F=E8=83=BD=E6=BA=90=E6= =AF=94=E4=BE=8B=E8=A1=A8" and > "=E6=B0=94=E5=80=99=E5=8F=98=E5=8C=96=E7=A0=94=E7=A9=B6_=E5=85=A8=E7=90= =83=E4=B8=BB=E8=A6=81=E5=9C=B0=E5=8C=BA=E6=9E=81=E7=AB=AF=E5=A4=A9=E6=B0=94= =E4=BA=8B=E4=BB=B6=E9=A2=91=E7=8E=87_=E5=B9=B4=E5=BA=A6=E7=81=BE=E5=AE=B3= =E6=8D=9F=E5=A4=B1=E4=B8=8E=E5=BA=94=E5=AF=B9=E6=8E=AA=E6=96=BD=E8=A1=A8" c= an 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 "=E8=83=BD=E6=BA=90=E7=BB=9F=E8=AE=A1= =E6=8E=92=E6=94=BE=E6=AF=94". The exact description could go in the table comment. Apart from that, it is a good idea to use table n= ames that are standard SQL identifiers, so that you don't have to double quote t= hem 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 inc= reases > the NAMEDATALEN constant to allow for 256-byte identifiers. This would be > particularly useful for databases that make extensive use of multi-byte c= haracter > sets like UTF-8. Wouldn't it be a good solution if we promote the #define to a configure opt= ion, like "./configure --identifier-length-limit=3D256"? Yours, Laurenz Albe