summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPeter Eisentraut2024-12-17 13:04:55 +0000
committerPeter Eisentraut2024-12-17 13:04:55 +0000
commitfb1a18810f07fc3b722392103d67ce8ed188b63d (patch)
treeea418d1a2e82d3104644f550c6a71366f3acfa6c /src/include
parentd3aad4ac57c5592ade77916404e6d8a989a1d6a1 (diff)
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
Diffstat (limited to 'src/include')
-rw-r--r--src/include/tsearch/ts_locale.h3
-rw-r--r--src/include/tsearch/ts_public.h2
2 files changed, 1 insertions, 4 deletions
diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h
index 71e1f78fa36..38b1a1ba90e 100644
--- a/src/include/tsearch/ts_locale.h
+++ b/src/include/tsearch/ts_locale.h
@@ -42,9 +42,6 @@ typedef struct
extern int t_isalpha(const char *ptr);
extern int t_isalnum(const char *ptr);
-extern char *lowerstr(const char *str);
-extern char *lowerstr_with_len(const char *str, int len);
-
extern bool tsearch_readline_begin(tsearch_readline_state *stp,
const char *filename);
extern char *tsearch_readline(tsearch_readline_state *stp);
diff --git a/src/include/tsearch/ts_public.h b/src/include/tsearch/ts_public.h
index e1549863a12..959bbcc00af 100644
--- a/src/include/tsearch/ts_public.h
+++ b/src/include/tsearch/ts_public.h
@@ -104,7 +104,7 @@ typedef struct
} StopList;
extern void readstoplist(const char *fname, StopList *s,
- char *(*wordop) (const char *));
+ char *(*wordop) (const char *, size_t, Oid));
extern bool searchstoplist(StopList *s, char *key);
/*