Обсуждение: pgsql: Separate out bytea sort support from varlena.c

Поиск
Список
Период
Сортировка

pgsql: Separate out bytea sort support from varlena.c

От
John Naylor
Дата:
Separate out bytea sort support from varlena.c

In the wake of commit b45242fd3, bytea_sortsupport() still called out
to varstr_sortsupport(). Treating bytea as a kind of text/varchar
required varstr_sortsupport() to allow for the possibility of
NUL bytes, but only for C collation. This was confusing. For
better separation of concerns, create an independent sortsupport
implementation in bytea.c.

The heuristics for bytea_abbrev_abort() remain the same as for
varstr_abbrev_abort(). It's possible that the bytea case warrants
different treatment, but that is left for future investigation.

In passing, adjust some strange looking comparisons in
varstr_abbrev_abort().

Author: Aleksander Alekseev <aleksander@tigerdata.com>
Reviewed-by: John Naylor <johncnaylorls@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAJ7c6TP1bAbEhUJa6+rgceN6QJWMSsxhg1=mqfSN=Nb-n6DAKg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9303d62c6db0207b8c2649205f7bc9350c1f62db

Modified Files
--------------
src/backend/utils/adt/bytea.c    | 238 ++++++++++++++++++++++++++++++++++++++-
src/backend/utils/adt/varlena.c  |  43 ++-----
src/tools/pgindent/typedefs.list |   1 +
3 files changed, 242 insertions(+), 40 deletions(-)


Re: pgsql: Separate out bytea sort support from varlena.c

От
Aleksander Alekseev
Дата:
Hi John,

> Separate out bytea sort support from varlena.c
>
> [...]

I noticed that the ByteaSortSupport.abbreviate field is not used for
anything. Here is the fix.

-- 
Best regards,
Aleksander Alekseev

Вложения

Re: pgsql: Separate out bytea sort support from varlena.c

От
John Naylor
Дата:
On Tue, Apr 14, 2026 at 9:56 PM Aleksander Alekseev
<aleksander@tigerdata.com> wrote:
> I noticed that the ByteaSortSupport.abbreviate field is not used for
> anything. Here is the fix.

Pushed, thanks.

--
John Naylor
Amazon Web Services