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 1v9NE2-00GzMi-KY for pgsql-docs@arkaria.postgresql.org; Thu, 16 Oct 2025 12:36:57 +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 1v9NE1-00Cazm-En for pgsql-docs@arkaria.postgresql.org; Thu, 16 Oct 2025 12:36:56 +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 1v9NE1-00Cazb-7d for pgsql-docs@lists.postgresql.org; Thu, 16 Oct 2025 12:36:56 +0000 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v9NDy-002WV4-0y for pgsql-docs@lists.postgresql.org; Thu, 16 Oct 2025 12:36:55 +0000 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-441fc0a9a7aso212385b6e.0 for ; Thu, 16 Oct 2025 05:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760618212; x=1761223012; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4b1GWdPRXfWog9YaKvtE2nCGnh0c+3WcEcV4K/GKyv8=; b=E4GLc0B9TheEcELnHV1Kdgomue3jYV4zatZvGY7BP1enzRGHHGVfVZg8FtKf3PASsS V4r2L5g9myBHXmoo9I101ECd6Dx1qNL2LLsNudFB5xV1mQ7nuCmVhgNI+JjkNCr7HREJ riU3qhiBXFNLKPCVNpWolE8WvNUEfv22JZauam/OVeGUTJdsOZhlr8YSSqI9PEe+eU2l PxNKFKqF0nDFJB0LC5Q/XLRl+IXv10wPIi4vysNEiQAuBQzCIhfwPyMiumqL52Nfqn2M vPituDV44NmJLJukY8hIgzcWosq4ct3DNLHkxBvFj6+HdcNy1NLNWiw89tguGmEXdkiz eD9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760618212; x=1761223012; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4b1GWdPRXfWog9YaKvtE2nCGnh0c+3WcEcV4K/GKyv8=; b=eSDVf9NDbDmtbCwSsXA1xxUjAd91oTtbq54cmTQM+XBw5qLrbr3KuUODUAbpYl7F0U 8XgXx8ws2h7srclJRUyq4G1bhHGXbzCMLV8p2ndmk9VVrkey169HeDNW2zW0zzRdgfZQ FiPu6YiGZQWdTgOAybJwFMpySs2MzR/7MNLC8e4ARWt48/glvhtq8BoP5Z3CIhItBXcU 3U85f2y29xN+0HBCdOGUhKOdvsLXBh+gsm/7Qo1D9oRvUpkULcVmHz6K65CTkYDeMy5C X7pLSp7+Kpse5gjIT1EMmQkjywor9DNzgqYvSsY42WT7+o7o2x1yy7u8ujxNL5X4yoOt AUGA== X-Forwarded-Encrypted: i=1; AJvYcCW+pS0u+Zv/YIGGjZeYOM6BxqlMDOWu89fCrDCat42PWCIp0GLqEOE2JU+Prho47dvW+8zOyUSGI2+Z@lists.postgresql.org X-Gm-Message-State: AOJu0YzapAmmqRBprCzNgQ0ZA5Mzl7nWFlJMXdmQM6nwtR0tVg/dzbXw B6vaiDbsYApDHQi3xC2AQWQxnFJS2lE9pewtIS0ncpT4JJMNo1Ab16z2LStLLR5s5co11ryEQ+X B5DVwM1JF9q/7Ece/3UXx11H/J03vnE8= X-Gm-Gg: ASbGncswQLwLy9mOHJKCvN6nHPeMrVA1N8fYwls/pBYnPw+OJki0spL2OUG1+YUDLjg 8Y6k1+fOqkMbMVZ9TBhXWTT7dl/x2yvX5XhsizHF/8rsjO8uBtmKMHNSsAcdRwSz0QibLLP9dTk QOivAbAQ9NfDgNxf60tramLoV6F0Q1I4XyQ9mfjNK10aHXHhozfG6U53MOCDRIQ8z1G4xBd6Bz5 1+NQPLpdmvPyqKJHOay11unurRXAgH2MhEsAtIR5biaQpAgqKbZJmLHgxYXNQ== X-Google-Smtp-Source: AGHT+IEQgTR9od6eXmdi78SNpXIUgJW/E8MX0kpGdRO8//CVaCmuLjOrO74/J0rQ5pOW9aDwaiCWwMbNWr7wI0ImolU= X-Received: by 2002:a05:6808:1918:b0:43f:9a39:9d09 with SMTP id 5614622812f47-4417b3e757amr13524575b6e.50.1760618212000; Thu, 16 Oct 2025 05:36:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6802:4486:b0:5f3:5bf6:6b0b with HTTP; Thu, 16 Oct 2025 05:36:50 -0700 (PDT) In-Reply-To: References: <176044409338.770.16064383081308443747@wrigleys.postgresql.org> <1307875.1760556576@sss.pgh.pa.us> From: "David G. Johnston" Date: Thu, 16 Oct 2025 08:36:50 -0400 X-Gm-Features: AS18NWA_egz8UMWrcX80ZeZ5mh3FNdZSnnE6AVRrgN-un4DMQc9Idrc_STtkZqg Message-ID: Subject: Re: BPCHAR description in 8.3. Character Types is misleading and incomplete To: Sergei Katkovsky Cc: Tom Lane , Jeff Davis , "pgsql-docs@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000001c87d4064145dfe9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001c87d4064145dfe9 Content-Type: text/plain; charset="UTF-8" On Thursday, October 16, 2025, Sergei Katkovsky wrote: > > I don't understand why any of these variants are better than the > > original wording "blank-padded". That has the non-negligible > > advantage of corresponding to the type name, and furthermore > > appears in many other places in our docs and source code. > > The wording for BPCHAR (not to be confused with BPCHAR(N) is already > "blank-trimming", not "blank-padded". And "blank-padded" is probably > the least correct wording variant for BPCHAR, because this type has > unlimited length and it's impossible to pad to the infinity. A given value has a finite length and there is just no restriction on what that length is. All trailing spaces in the input are considered padding for purposes of comparison i.e., manually padding is added by the user as opposed to the system. So bpchar(n) is automatically blank padded to a total length for a value of n characters. bpchar also has padding blanks but they must be manually inserted during value creation. I would leave the note of blank-padded for both and just point out the automatic vs manual distinction. David J. --0000000000001c87d4064145dfe9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thursday, October 16, 2025, Sergei Katkovsky <skatkovsky@gmail.com> wrote:
> I don't understand why any of these variants are bet= ter than the
> original wording "blank-padded".=C2=A0 That has the non-negl= igible
> advantage of corresponding to the type name, and furthermore
> appears in many other places in our docs and source code.

The wording for BPCHAR (not to be confused with BPCHAR(N) is already
"blank-trimming", not "blank-padded". And "blank-p= added" is probably
the least correct wording variant for BPCHAR, because this type has
unlimited length and it's impossible to pad to the infinity.

A given value has a finite length and there is just n= o restriction on what that length is.=C2=A0 All trailing spaces in the inpu= t are considered padding for purposes of comparison i.e., manually padding = is added by the user as opposed to the system.

So = bpchar(n) is automatically blank padded to a total length for a value of n = characters. =C2=A0bpchar also has padding blanks but they must be manually = inserted during value creation.

I would leave the = note of blank-padded for both and just point out the automatic vs manual di= stinction.

David J.

--0000000000001c87d4064145dfe9--