pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove ts_locale.c's t_isdigit(), t_isspace(), t_isprint()
Date: Tue, 17 Dec 2024 11:57:08 +0000
Message-ID: <E1tNWCJ-0001oo-J1@gemulon.postgresql.org> (raw)

Remove ts_locale.c's t_isdigit(), t_isspace(), t_isprint()

These do the same thing as the standard isdigit(), isspace(), and
isprint() but with multibyte and encoding support.  But all the
callers are only interested in analyzing single-byte ASCII characters.
So this extra layer is overkill and we can replace the uses with the
standard functions.

All the t_is*() functions in ts_locale.c are under scrutiny because
they don't use the common locale provider framework but instead use
the global libc locale settings.  For the functions being touched by
this patch, we don't need all that anyway, as mentioned above, so the
simplest solution is to just remove them.  The few remaining t_is*()
functions will need a different treatment in a separate patch.

pg_trgm has some compile-time options with macros such as
KEEPONLYALNUM.  These are not documented, and the non-default variant
is not supported by any test cases.  As part of this undertaking, I'm
removing the non-default variant, as it is in the way of cleanup.  So
in this case, the not-KEEPONLYALNUM code path is gone.

Reviewed-by: Jeff Davis <pgsql@j-davis.com>
Discussion: https://www.postgresql.org/message-id/flat/653f3b84-fc87-45a7-9a0c-bfb4fcab3e7d%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d3aad4ac57c5592ade77916404e6d8a989a1d6a1

Modified Files
--------------
contrib/dict_xsyn/dict_xsyn.c           |  4 +--
contrib/ltree/ltree_io.c                |  8 +++---
contrib/ltree/ltxtquery_io.c            |  2 +-
contrib/pg_trgm/trgm.h                  |  6 -----
contrib/unaccent/unaccent.c             |  2 +-
src/backend/tsearch/dict_synonym.c      |  4 +--
src/backend/tsearch/dict_thesaurus.c    | 10 ++++----
src/backend/tsearch/spell.c             | 44 ++++++++++++++++----------------
src/backend/tsearch/ts_locale.c         | 45 ---------------------------------
src/backend/tsearch/ts_utils.c          |  2 +-
src/backend/utils/adt/tsquery.c         | 12 ++++-----
src/backend/utils/adt/tsvector_parser.c | 10 ++++----
src/include/tsearch/ts_locale.h         |  3 ---
13 files changed, 49 insertions(+), 103 deletions(-)



Message-ID: <E1tNWCJ-0001oo-J1@gemulon.postgresql.org>
Permalink:  ../E1tNWCJ-0001oo-J1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tNWCJ-0001oo-J1@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Remove ts_locale.c's t_isdigit(), t_isspace(), t_isprint()
  In-Reply-To: <E1tNWCJ-0001oo-J1@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox