BPCHAR description in 8.3. Character Types is misleading and incomplete

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема BPCHAR description in 8.3. Character Types is misleading and incomplete
Дата
Msg-id CAKFQuwbfQ_uP+vot0ys_wo4cS6ZCpn=aZxhVGZ-tt_4HB7CVHw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BPCHAR description in 8.3. Character Types is misleading and incomplete  (Sergei Katkovsky <skatkovsky@gmail.com>)
Ответы Re: BPCHAR description in 8.3. Character Types is misleading and incomplete
Список pgsql-docs
On Thursday, October 16, 2025, Sergei Katkovsky <skatkovsky@gmail.com> wrote:
 
Manual addition is not padding, If it were, then VARCHAR would also be
"blank-padded", because you can manually add trailing blanks to values
of this type too. But of course it isn't.

The spaces added to the end of a bpchar manually can and are considered “padding” - or “present but lack semantic/value significance”. The reason they are not padding for varchar is that such spaces are considered part of the stored value from a semantic perspective.

Think of padding as a noun, not a verb.  “The value contains padding”.  Not, “ I am padding the value”.

And yes, this is intended as a way to make the name of the type and its behavior consistent.  You sorta have to want it to work/make sense; not fight it on minor nuance.

David J.

В списке pgsql-docs по дате отправления: