Re: BPCHAR description in 8.3. Character Types is misleading and incomplete

From: Sergei Katkovsky <skatkovsky(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Davis <pgsql(at)j-davis(dot)com>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: BPCHAR description in 8.3. Character Types is misleading and incomplete
Date: 2025-10-17 07:37:40
Message-ID: CAAf8Jy+49UAExghnssRR4oACSVGk7HejrU7GipdijWWBsbPt4Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Fri, Oct 17, 2025 at 1:08 AM David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
>
> I’m just trying to phrase the documentation for bpchar so that the “bp”, which stands for “blank-padded”, is justified.

That's what I thought. Yes, unfortunately, bp stands for
“blank-padded”, but this name is wrong and misleading. I don't know
why it was chosen, maybe it was actually considered as blank-padded at
that time, maybe it was an attempt to avoid introducing a new keyword
(an ancient curse that has ruined a lot of good ideas already). It
doesn't matter, though. That was a mistake in my opinion, but we don't
have to repeat it. There is no need to justify wrongs. An honest
remark (footnote, tip, whatever) in documentation "Although BP in
BPCHAR stands for 'blank-padded', no padding is actually performed for
this type" would be far better.

>
> I do understand the terminology confusion with the verb padding. And see why “trimmed” is actively confusing. The prose probably needs to resolve this - and technically does from what I’m reading.
>
> You may wish to move on from critiquing my suggested changes and instead propose something concrete of your own. Provide a third choice besides status-quo and my option.

I already did this. It was my original request that started this
discussion, and I suggested there, although more as a guide,
"as-if-blank-trimmed" and "blank-ignoring". But then Jeff Davis
prepared a patch and proposed "blank-insignificant" instead, which I
support now (after that, I also suggested "blank-agnostic", but that
was more of a joke). So, the third choice already exists, and there is
even a patch implementing it.

Of course, "blank-insignificant" is not perfect either, specifically,
it's not immediately obvious that only trailing blanks are
insignificant here. Perhaps a better term would be
"trailing-blanks-insignificant", with or without hyphens. But in my
opinion. both are much more appropriate and less misleading than
either "blank-padded" or "blank-trimmed".

>
> Though I’m doubtful there is a nice precise hyphenated word to be found here for “treats any trailing spaces as being semantically insignificant”.

Yes, but nobody requires us to use such a word here. We can use a few
more words if needed.

With best regards,
Sergei Katkovskii

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2025-10-17 12:49:12 Re: BPCHAR description in 8.3. Character Types is misleading and incomplete
Previous Message Tom Lane 2025-10-16 22:12:03 Re: Can not close psql