Introduce t_isalnum() to replace t_isalpha() || t_isdigit() tests.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: ca71131eebba63809ceb86be033a264a5f0a1d79
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2022-10-06T15:08:56Z
Releases: 16.0
Introduce t_isalnum() to replace t_isalpha() || t_isdigit() tests.

ts_locale.c omitted support for "isalnum" tests, perhaps on the
grounds that there were initially no use-cases for that.  However,
both ltree and pg_trgm need such tests, and we do also have one
use-case now in the core backend.  The workaround of testing
isalpha and isdigit separately seems quite inefficient, especially
when dealing with multibyte characters; so let's fill in the
missing support.

Discussion: https://postgr.es/m/2548310.1664999615@sss.pgh.pa.us

Files

PathChange+/−
contrib/ltree/ltree.h modified +1 −1
contrib/pg_trgm/trgm.h modified +1 −1
src/backend/tsearch/ts_locale.c modified +16 −0
src/backend/utils/adt/tsquery.c modified +1 −1
src/include/tsearch/ts_locale.h modified +1 −0

Discussion