From 3ef930ff2e93fe60738b3db2aedb771a1035cebe Mon Sep 17 00:00:00 2001 From: "Anton A. Melnikov" Date: Fri, 20 Mar 2026 06:36:45 +0300 Subject: [PATCH] PGPRO-17631: Remove support for 18+ versions. Revert "PGPRO-12044: Use str_tolower instead of removed lowerstr and lowerstr_with_len." This reverts commit 56c47f03f4f1bb26327494227e21a8a8a841e585. Partially revert "PGPRO-10866: Use const decoration to avoid warnings:" related to d5f139cb6814f0af2d2e1106899361e45c305630 (PostgeSQL) Revert "PGPRO-12044: Add output variant for PG18 for contrib/shared_ispell/sql/security.sql test." This reverts commit bd5eeb2a3fddc733cebcc19c2e4d89990431e604. Limit supported PostgreSQL versions to 17 in readme. Tags: shared_ispell --- README.md | 9 ++++++-- expected/security_1.out | 50 ----------------------------------------- src/shared_ispell.c | 10 ++++----- 3 files changed, 11 insertions(+), 58 deletions(-) delete mode 100644 expected/security_1.out diff --git a/README.md b/README.md index 9f9b6d8..ebcc467 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Install Before build and install `shared_ispell` you should ensure following: -* PostgreSQL version is 9.6 or later. +* PostgreSQL version is from 9.6 to 17 [^1] Installing the extension is quite simple. In that case all you need to do is this: @@ -154,4 +154,9 @@ but there is not related code in the GitHub. Author ------ -Tomas Vondra [GitHub](https://github.com/tvondra) \ No newline at end of file +Tomas Vondra [GitHub](https://github.com/tvondra) + +Notes +------ + +[^1]: If you would like support for newer versions, please contact us: [info@postgrespro.ru](mailto:info@postgrespro.ru?subject=shared_ispell) \ No newline at end of file diff --git a/expected/security_1.out b/expected/security_1.out deleted file mode 100644 index 7897886..0000000 --- a/expected/security_1.out +++ /dev/null @@ -1,50 +0,0 @@ -create type si_dicts_result as (dict_name VARCHAR, affix_name VARCHAR, words INT, affixes INT, bytes INT); -create function shared_ispell_dicts( OUT dict_name VARCHAR, OUT affix_name VARCHAR, OUT words INT, OUT affixes INT, OUT bytes INT) -returns SETOF record as $$ -declare - qString varchar(4000); - rec si_dicts_result; -begin - qString := 'select * from shared_ispell_dicts()'; - for rec in execute qString loop - return NEXT; - end loop; - return; -end -$$ language plpgsql; -create extension shared_ispell; -ERROR: function "shared_ispell_dicts" already exists with same argument types -CONTEXT: SQL statement "CREATE FUNCTION shared_ispell_dicts( OUT dict_name VARCHAR, OUT affix_name VARCHAR, OUT words INT, OUT affixes INT, OUT bytes INT) - RETURNS SETOF record - AS '$libdir/shared_ispell', 'dispell_list_dicts' - LANGUAGE C IMMUTABLE" -extension script file "shared_ispell--1.1.0.sql", near line 26 -drop extension if exists shared_ispell; -NOTICE: extension "shared_ispell" does not exist, skipping -drop type si_dicts_result; -drop function shared_ispell_dicts(); -create type si_stoplists_result as (stop_name VARCHAR, words INT, bytes INT); -create function shared_ispell_stoplists(OUT stop_name VARCHAR, OUT words INT, OUT bytes INT) -returns SETOF record as $$ -declare - rec si_stoplists_result; - qString varchar(4000); -begin - qString := 'select * from shared_ispell_stoplists()'; - for rec in execute qString loop - return NEXT; - end loop; - return; -end -$$ language plpgsql; -create extension shared_ispell; -ERROR: function "shared_ispell_stoplists" already exists with same argument types -CONTEXT: SQL statement "CREATE FUNCTION shared_ispell_stoplists( OUT stop_name VARCHAR, OUT words INT, OUT bytes INT) - RETURNS SETOF record - AS '$libdir/shared_ispell', 'dispell_list_stoplists' - LANGUAGE C IMMUTABLE" -extension script file "shared_ispell--1.1.0.sql", near line 31 -drop extension if exists shared_ispell; -NOTICE: extension "shared_ispell" does not exist, skipping -drop type si_stoplists_result; -drop function shared_ispell_stoplists(); diff --git a/src/shared_ispell.c b/src/shared_ispell.c index 73f38d3..68f9904 100644 --- a/src/shared_ispell.c +++ b/src/shared_ispell.c @@ -54,10 +54,8 @@ #include "storage/ipc.h" #include "storage/shmem.h" -#include "catalog/pg_collation_d.h" #include "commands/defrem.h" #include "tsearch/ts_locale.h" -#include "utils/formatting.h" #include "access/htup_details.h" #include "funcapi.h" #include "utils/builtins.h" @@ -348,7 +346,7 @@ init_shared_dict(DictInfo *info, MemoryContext infoCntx, dict->useFlagAliases = true; dict->lenAffixData = info->dict.lenAffixData; dict->nAffixData = info->dict.nAffixData; - dict->AffixData = (const char **) palloc0(dict->nAffixData * sizeof(char *)); + dict->AffixData = (char **) palloc0(dict->nAffixData * sizeof(char *)); for (i = 0; i < dict->nAffixData; i++) dict->AffixData[i] = pstrdup(info->dict.AffixData[i]); @@ -394,7 +392,7 @@ init_shared_dict(DictInfo *info, MemoryContext infoCntx, { StopList stoplist; - readstoplist(stopFile, &stoplist, str_tolower); + readstoplist(stopFile, &stoplist, lowerstr); size = sizeStopList(&stoplist, stopFile); if (size > segment_info->available) @@ -612,7 +610,7 @@ dispell_lexize(PG_FUNCTION_ARGS) if (len <= 0) PG_RETURN_POINTER(NULL); - txt = str_tolower(in, len, DEFAULT_COLLATION_OID); + txt = lowerstr_with_len(in, len); /* need to lock the segment in shared mode */ LWLockAcquire(segment_info->lock, LW_SHARED); @@ -820,7 +818,7 @@ copyIspellDict(IspellDict *dict, char *dictFile, char *affixFile, int size, int /* copy affix data */ copy->dict.nAffixData = dict->nAffixData; - copy->dict.AffixData = (const char **) shalloc(sizeof(char *) * dict->nAffixData); + copy->dict.AffixData = (char **) shalloc(sizeof(char *) * dict->nAffixData); for (i = 0; i < copy->dict.nAffixData; i++) copy->dict.AffixData[i] = shstrcpy(dict->AffixData[i]);