postgres/contrib/pg_trgm
Peter Eisentraut fb1a18810f Remove ts_locale.c's lowerstr()
lowerstr() and lowerstr_with_len() in ts_locale.c do the same thing as
str_tolower() that the rest of the system uses, except that the former
don't use the common locale provider framework but instead use the
global libc locale settings.

This patch replaces uses of lowerstr*() with str_tolower(...,
DEFAULT_COLLATION_OID).  For instances that use a libc locale
globally, this will result in exactly the same behavior.  For
instances that use other locale providers, you now get consistent
behavior and are no longer dependent on the libc locale settings (for
this case; there are others).

Most uses of these functions are for processing dictionary and
configuration files.  In those cases, using the default collation
seems appropriate.  At least we don't have a more specific collation
available.  But the code in contrib/pg_trgm should really depend on
the collation of the columns being processed.  This is not done here,
this can be done in a separate patch.

(You can probably construct some edge cases where this change would
create some locale-related upgrade incompatibility, for example if
before you used a combination of ICU and a differently-behaving libc
locale.  We can document this in the release notes, but I don't think
there is anything more we can do about this.)

Reviewed-by: Jeff Davis <pgsql@j-davis.com>
Discussion: https://www.postgresql.org/message-id/flat/653f3b84-fc87-45a7-9a0c-bfb4fcab3e7d%40eisentraut.org
2024-12-17 14:04:55 +01:00
..
data Add files forgotten in f576b17cd6 2016-03-16 19:23:41 +03:00
expected Fix arrays comparison in CompareOpclassOptions() 2024-11-12 01:44:20 +02:00
sql Fix arrays comparison in CompareOpclassOptions() 2024-11-12 01:44:20 +02:00
.gitignore
Makefile Handle equality operator in contrib/pg_trgm 2020-11-15 08:52:35 +03:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_trgm--1.1--1.2.sql Add word_similarity to pg_trgm contrib module. 2016-03-16 18:59:21 +03:00
pg_trgm--1.2--1.3.sql Make contrib modules' installation scripts more secure. 2020-08-10 10:44:42 -04:00
pg_trgm--1.3--1.4.sql Add strict_word_similarity to pg_trgm module 2018-03-21 14:57:42 +03:00
pg_trgm--1.3.sql Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00
pg_trgm--1.4--1.5.sql Fix typo in contrib/pg_trgm/pg_trgm--1.4--1.5.sql 2020-11-12 08:55:09 +03:00
pg_trgm--1.5--1.6.sql Handle equality operator in contrib/pg_trgm 2020-11-15 08:52:35 +03:00
pg_trgm--1.0--1.1.sql Fix typo in update scripts for some contrib modules. 2013-07-19 04:13:01 +09:00
pg_trgm.control Handle equality operator in contrib/pg_trgm 2020-11-15 08:52:35 +03:00
trgm_gin.c New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
trgm_gist.c Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00
trgm_op.c Remove ts_locale.c's lowerstr() 2024-12-17 14:04:55 +01:00
trgm_regexp.c Remove ts_locale.c's lowerstr() 2024-12-17 14:04:55 +01:00
trgm.h Remove ts_locale.c's t_isdigit(), t_isspace(), t_isprint() 2024-12-17 12:52:29 +01:00