=== Applying patches on top of PostgreSQL commit ID 6831cd9e3b082d7b830c3196742dd49e3540c49b === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Jan 16 19:50:26 UTC 2026 On branch cf/6174 nothing to commit, working tree clean === using 'git am' to apply patch ./v13-0001-fuzzystrmatch-use-pg_ascii_toupper.patch === Applying: fuzzystrmatch: use pg_ascii_toupper(). Using index info to reconstruct a base tree... M contrib/fuzzystrmatch/dmetaphone.c M contrib/fuzzystrmatch/fuzzystrmatch.c Falling back to patching base and 3-way merge... Auto-merging contrib/fuzzystrmatch/fuzzystrmatch.c Auto-merging contrib/fuzzystrmatch/dmetaphone.c CONFLICT (content): Merge conflict in contrib/fuzzystrmatch/dmetaphone.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 fuzzystrmatch: use pg_ascii_toupper(). When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M contrib/fuzzystrmatch/dmetaphone.c === using patch(1) to apply patch ./v13-0001-fuzzystrmatch-use-pg_ascii_toupper.patch === patching file contrib/fuzzystrmatch/dmetaphone.c Hunk #1 succeeded at 98 with fuzz 2. Hunk #2 succeeded at 118 with fuzz 2 (offset 1 line). Hunk #3 FAILED at 286. Hunk #4 succeeded at 472 (offset 5 lines). 1 out of 4 hunks FAILED -- saving rejects to file contrib/fuzzystrmatch/dmetaphone.c.rej patching file contrib/fuzzystrmatch/fuzzystrmatch.c Hunk #1 FAILED at 62. Hunk #2 FAILED at 122. Hunk #3 FAILED at 301. Hunk #4 FAILED at 340. Hunk #5 FAILED at 379. Hunk #6 FAILED at 478. Hunk #7 FAILED at 731. Hunk #8 FAILED at 742. 8 out of 8 hunks FAILED -- saving rejects to file contrib/fuzzystrmatch/fuzzystrmatch.c.rej Unstaged changes after reset: M contrib/fuzzystrmatch/dmetaphone.c Removing contrib/fuzzystrmatch/dmetaphone.c.rej Removing contrib/fuzzystrmatch/fuzzystrmatch.c.rej === using 'git apply' to apply patch ./v13-0001-fuzzystrmatch-use-pg_ascii_toupper.patch === Applied patch to 'contrib/fuzzystrmatch/dmetaphone.c' with conflicts. Applied patch to 'contrib/fuzzystrmatch/fuzzystrmatch.c' cleanly. U contrib/fuzzystrmatch/dmetaphone.c diff --cc contrib/fuzzystrmatch/dmetaphone.c index 062667527c2,9a4e5ae7e0e..00000000000 --- a/contrib/fuzzystrmatch/dmetaphone.c +++ b/contrib/fuzzystrmatch/dmetaphone.c @@@ -98,8 -98,8 +98,9 @@@ The remaining code is authored by Andre #include "postgres.h" + #include "mb/pg_wchar.h" #include "utils/builtins.h" +#include "utils/formatting.h" /* turn off assertions for embedded function */ #define NDEBUG @@@ -117,8 -117,11 +118,11 @@@ #include #include + #define SMALL_LETTER_C_WITH_CEDILLA '\xe7' + #define CAPITAL_LETTER_C_WITH_CEDILLA '\xc7' + /* prototype for the main function we got from the perl module */ -static void DoubleMetaphone(char *str, char **codes); +static void DoubleMetaphone(const char *str, Oid collid, char **codes); #ifndef DMETAPHONE_MAIN @@@ -279,17 -282,50 +283,61 @@@ IncreaseBuffer(metastring *s, int chars } -static void -MakeUpper(metastring *s) +static metastring * +MakeUpper(metastring *s, Oid collid) { ++<<<<<<< ours + char *newstr; + metastring *newms; + + newstr = str_toupper(s->str, s->length, collid); + newms = NewMetaString(newstr); + DestroyMetaString(s); + + return newms; ++======= + char *i; + bool c_with_cedilla; + + /* + * C WITH CEDILLA should be uppercased, as well. + * + * XXX: Only works in single-byte encodings that encode lowercase C WITH + * CEDILLA as \xe7. Should have proper multibyte support. + * + * NB: WIN1256 encodes only the lowercase C WITH CEDILLA, but for the + * purposes of metaphone, we can still "uppercase" it to \xc7 here so that + * it's recognized later. + */ + switch (GetDatabaseEncoding()) + { + case PG_LATIN1: + case PG_LATIN2: + case PG_LATIN3: + case PG_LATIN5: + case PG_LATIN8: + case PG_LATIN9: + case PG_LATIN10: + case PG_WIN1250: + case PG_WIN1252: + case PG_WIN1254: + case PG_WIN1256: + case PG_WIN1258: + c_with_cedilla = true; + break; + default: + c_with_cedilla = false; + break; + } + + for (i = s->str; *i; i++) + { + if (c_with_cedilla && *i == SMALL_LETTER_C_WITH_CEDILLA) + *i = CAPITAL_LETTER_C_WITH_CEDILLA; + else + *i = pg_ascii_toupper((unsigned char) *i); + } ++>>>>>>> theirs }